codeice / linqtoexcel

Automatically exported from code.google.com/p/linqtoexcel
0 stars 0 forks source link

Excel XML formatted file must be open in Excel to be read #105

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I downloaded an Excel file in XML format
2. Wrote a simple method that would open the file, use a linq expression on a 
WorksheetRange, and select rows.
3. Attempted to iterate through the rows

What is the expected output? What do you see instead?
Proper iteration through the rows in the spreadsheet. Instead an exception was 
thrown (External table is not in the expected format.).

What version of the product are you using? On what operating system?
LinqToExcel 1.7.1 (64-bit) on Windows 7 Pro.

Please provide any additional information below.
My initial work was done while I had a spreadsheet open and my code and related 
unit tester were working as expected. The spreadsheet was downloaded from a 3rd 
party and is in the Excel XML format. While the spreadsheet was open in Excel, 
everything was fine.

The next day I started to build out the web application and my service (to do 
the reading) was failing. Ultimately I went back to the unit tester and it was 
now failing as well. Ultimately realized the variable was having the 
spreadsheet open (which caused it to start working). I attempted various things 
-- different file extensions, dictating the Database Engine (JET -> ACE), etc.

If I open the spreadsheet and do a save-as to Excel Workbook (xlsx) then the 
resulting file works fine through LinqToExcel. It appears this issue may be 
related to the Excel XML handling -- and seemed to result in the same error 
regardless of Database Engine.

Original issue reported on code.google.com by b...@brybelly.com on 16 Apr 2014 at 6:45

GoogleCodeExporter commented 8 years ago
Hi Bob,

This seems to be an issue with the database engine (either Jet or Ace) and not 
with LinqToExcel. Sorry, but I can't provide any more help. I recommend 
checking StackOverflow

Original comment by paulyo...@gmail.com on 18 Apr 2014 at 3:14

GoogleCodeExporter commented 8 years ago
Hi Paul,

I went through the questions on StackOverflow and this was a different problem 
- the ones referenced there were largely resolved by simply using the proper 
Database Engine when processing.

This problem only happens when attempting to process an Excel spreadsheet that 
was saved in XML format. If I converted it to a xls or xlsx format, then the 
code worked properly. Attempting with Ace OR Jet made no difference (and I 
wonder if both of them have a dependency on some sort of XML parser under the 
covers.

In fact my business workaround is for them to download the generated 
spreadsheet, open it, save-as to an xlsx, and then upload it to my application.

Original comment by b...@brybelly.com on 18 Apr 2014 at 5:59

GoogleCodeExporter commented 8 years ago
After one year, did anyone solved this somehow? I'm having the same issue and 
using the same workaround, but it would be great to have a solution. Thanks :)

Original comment by henriq...@ciandt.com on 28 Jul 2015 at 6:33