p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Pro VB 6 (http://p2p.wrox.com/forumdisplay.php?f=73)
-   -   selecting records from excel (http://p2p.wrox.com/showthread.php?t=23671)

androoo January 10th, 2005 06:13 AM

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...

BrianWren January 12th, 2005 12:18 PM

What happens when you try this?


All times are GMT -4. The time now is 11:08 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.