Error Reading Excel Numeric Column Names

  • Thread starter Thread starter Rohit
  • Start date Start date
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'"
 
¤ 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)
 
Back
Top