View Single Post
  #1 (permalink)  
Old January 10th, 2005, 06:13 AM
androoo androoo is offline
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default selecting records from excel

Hi

Im having some troubles talking to excel from my vb addin I made.
This code to send data to excel from a db works great:

Dim xlApp As Excel.Application
Dim xlWb As Workbook
Dim xlWs As Worksheet

Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.Workbooks.Add
Set xlWs = xlWb.Worksheets("Sheet1")

Now im now trying to pick up the changes and send it back from the active excel workbook, I cant seem to reference the active workbook...
This is the code im using:

Dim xlApp As Excel.Application
Dim xlWb As Workbook
Dim xlWs As Worksheet

Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.ActiveWorkbook
Set xlWs = xlWb.ActiveSheet

Any ideas from anyone ?

Thanks andy...
Reply With Quote