|
-
Sep 6th, 2009, 01:32 PM
#1
Thread Starter
Hyperactive Member
Excel reading error
Hi guys,
I've a problem with reading excel. The case is like this, I need to read an Excel file that is exported from another application (i don't know how they export it). So, once the excel file exported, in my application i click a button and start reading the excel file. But it gives me error as this:
External table is not in the expected format.
After i investigated, I need to open the excel file while doing the import from my application, or i need to save the excel file into a proper excel format 1st before i can actually import the data when the excel is not open. When i click save in the excel, it pops up a message saying:
abc.xls may contain features that are not compatible with Text (Tab delimited). Do you want to keep the workbook in this format?
At this stage I'll need to click No in the message box and save a copy to latest excel format, which the message in option 2:
To preserve the features, click No. Then save a copy in the latest Excel format.
How can I actually read it without save as the latest Excel format? Or programmatically done in VB.NET code to save as a proper excel format? This is how I done now for the OLEDB connection:
a Code:
Dim _Connection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:\abc.xls;" & _
"Extended Properties='Excel 8.0; HDR=Yes; IMEX=1'")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|