Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2823

Re: OLE and Excel

$
0
0

io_ole.ConnectToNewObject( "Excel.Application" )

connects you to excel application

but then

lnvo_ole.io_ole.ConnectToObject( fileName[ lp ])

you connect the OLEobject to a excel workbook.

 

A Workbook object doesn't have a ActiveWorkbook property.

 

You have to made a decision:

You may connect to Excel.Application. Don't use ConnectToObject in this case! Use io_ole.Workbooks.Open to open the file you want to read. Close the file with ActiveWorkbook.Close. Quit excel if you read all files with Application.Quit.

 

Or you wan't to connect the OLEObject to the excel file. Then you shouln't use ConnectToNewObject. Disconnect the OLEObject if you finished reading the file. After that you can connect to the next file. I think you don't need to close the file and application in this case.


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>