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

Re: OLE and Excel

$
0
0

Thanks for all of the answers, but I still can't the programming to work.

With some MINOR changes, this is the actual programming below

 

nvo_ole     lnvo_ole

 

for lp = 1 to filecount

 

     if isValid( lnvo_ole)=False then

          lnvo_ole = Create nvo_ole

          io_ole = Create OleObject     // this is in a function call, io_ole is an instance variable in the nvo

          io_ole.ConnectToNewObject( "Excel.Application" )     // in the same function call as above

     end if

 

     lnvo_ole.io_ole.ConnectToObject( fileName[ lp ] // function call in the nvo

 

     ... Read the Excel file and move data into a datastore // this works correctly

    

     // this line throws an error, which I trapped with Catch Try

     // error is Name not found accessing external object property activeworkbook...

     // lnvo_ole.ActiveWorkBook.Close()

    

     // this line throws an error, which I trapped

     // error is Name not found accessing external object property application...

     // lnvo_ole.io_ole.Application.Quit()

    

     lnvo_ole.io_ole.Disconnect()     // nvo function call

 

     // tried this, but it still doesn't work, i get the same data as the first file

     Destroy lnvo_ole

 

next


Viewing all articles
Browse latest Browse all 2812

Trending Articles



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