Error Reading Excel Numeric Column Names

R

Rohit

I am using GetOleDbSchemaTable to read the data from the Excel file. It is
working fine with all workbook/worksheets except the one that has numeric
column names as headers.

The connection string is
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
finfo.FullName + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1'"
 
P

Paul Clement

¤ I am using GetOleDbSchemaTable to read the data from the Excel file. It is
¤ working fine with all workbook/worksheets except the one that has numeric
¤ column names as headers.
¤
¤ The connection string is
¤ strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
¤ finfo.FullName + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1'"
¤

Numeric values are not valid column names. Those columns names will be changed to the default column
names when no header is specified (e.g. F1, F2, F3, etc.).


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top