0
votes

We have an old application written using VC++ that uses ODBC driver to read the excel data.

There are problems in current code with mixed data type and limitations of ODBC driver.

SO I am planning to use Jet OLE DB driver and use ADO

The code I have opens ADO connection and reads excel sheet.No issues here..

The biggest problem is everytime, Open() is called, it brings up the Excel sheet and displays to the user (if it is not already open). I tried to look into the parameters, but did not find any suggestions to hide main excel window.

Any suggestions?

The connection string I am using is

Provider='Microsoft.JET.OLEDB.4.0';Data Source=temp.xls;Extended Properties="Excel 8.0;IMEX=1;HDR=NO"

1
It is Provider='Microsoft.JET.OLEDB.4.0';Data Source=temp.xls;Extended Properties="Excel 8.0;IMEX=1;HDR=NO"buzzy2020

1 Answers

0
votes

Three options spring to mind:

  1. Use Automation to open the spreadsheet in a hidden window. I.e. you can create an instance of the Excel application, hide the main window, and open the spreadsheet in that window.
  2. Use the ISAM driver instead of the JET driver. That may change the behaviour in undesirable ways though.
  3. Live with it.