CreateObject creates an instance of Excel. The easiest workaround is
available even in VB6 which i think you did not try in VB6 itself. If you
are using ADODB, Create two different connections. One with your SQL server
and the other with the excel file. You can use the Jet OLEDB provider to
conect to EXCEL files. The only change will be that the SQL string will be
like
"select * from [Sheet1]"
of course with square brackets for sheet name which is considered as table.
In this way your whole excel data is in your recordset. Doing your
processing between recordsets which has Cachesize property set with an
optimised value something like 200 can make extraordinary performance
difference.
Now in Dot NET you can still open Excel files as Dataset or Datareader as
required. You have to find methods or providers and how to do this yourself.
The moral of the story is not to use CreateObject or GetObject. To get the
connection string of how to connect to excel files or text files using ADODB
or DotNET in multiple languages, check
www.able-consulting.com and find
connection strings page.
I have done this with Excel files with 125 columns and over 80,000 rows with
multiple sheets and processed against AS400 tables [PF] using VB6's ADODB
connections. [ADODB connections are independent in same project for both
Excel and AS400]
Good luck
Raja Venkatesh
(e-mail address removed)