jbradleyharris
Programmer
I am having a problem using ADO open an Excel spreadsheet. If I add the extended property parameter "HDR=NO" I get an "Error Number:-2147467259, Could not find installable ISAM." message. If I leave it off the connection succeeds but I lose the first row because there is no header row in the spreadsheet. The spreadsheet is created by an external process so adding a header row is not really an option. I assume I am doing something wrong but for the life of me I can't figure out what. Here are my two connection strings:
This one works -> strMyConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strSourceFile & ";Extended Properties=Excel 12.0 Xml"
This on fails -> strMyConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strSourceFile & ";Extended Properties=Excel 12.0 Xml;HDR=No"
Other than that what I'm doing is as simple as can be:
Dim cn as ADODB.Connection
Set cn = New ADODB.Connection
cn.Open strMyConnect
I have references to the Microsoft ActiveX Data Objects 2.8 Library and the Microsoft Excel 14.0 Object Library in my project.
Any suggestions would be greatly appreciated.
This one works -> strMyConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strSourceFile & ";Extended Properties=Excel 12.0 Xml"
This on fails -> strMyConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strSourceFile & ";Extended Properties=Excel 12.0 Xml;HDR=No"
Other than that what I'm doing is as simple as can be:
Dim cn as ADODB.Connection
Set cn = New ADODB.Connection
cn.Open strMyConnect
I have references to the Microsoft ActiveX Data Objects 2.8 Library and the Microsoft Excel 14.0 Object Library in my project.
Any suggestions would be greatly appreciated.