Hi,
I'm trying to load an Excel file and the Load function through an exception 'Attempted to read past the end of the stream'
It is an Excel 2003 file and I can open it using Excel.
Thanks for your help,
Can you post the code that is giving you this exception?
Hi Mike,
The exception occurs when openning the file:
Workbook workbook = Infragistics.Excel.Workbook.Load(fileName);
This is working with hundreds of files but with 1 or 2 of them we have a problem. If you like I can email you the excel.
Thanks
Hm, that code is pretty simple, so that's pretty clearly a bug.
The first thing I recommend is that you get the latest service release if you do not already have it. Perhaps this is a known issue and is already fixed.
How to get the latest service release - Infragistics Community
If that does not help, we'd need to check it out further, so it would be great if you could post the Excel files here or submit them to Infragistics Developer Support.
Getting the same error here, again with specific excel 2003 files. I've uploaded this to developer support already, but attached is a copy of a file i'm getting the problem with
Hello Kevin,
Can you try to use this code instead than the method "Load" and tell me if it works for you?
Dim wb As Workbook
Dim ws As Worksheet
wb =
New Workbook()
ws = wb.Worksheets.Add(
"aldebaran 132wb.xls")
'wb = Infragistics.Excel.Workbook.Load("aldebaran 132wb.xls")
Sincerely,MatteoDeveloper Support EngineerInfragisticswww.infragistics.com/support
Hi Matteo,
That doesn't seem right - doesn't that just add a new worksheet with the given name? I gave it a try anyway. First time I got an exception due to having a '\' in the name of a sheet (my filename is a full path (eg, c:\temp\aldebaran 132wb.xls) rather than just a filename) which kind of fits with the whole "add sheet not load file" thing. Tried it with just the filename and it just added a sheet with that name.
So, not much use I'm afraid. Did you try it yourself?
Kev
Hello ,
On the following link you could review our Product Lifecycle:
http://ko.infragistics.com/help/product-lifecycle/
Infragistics 12.1 was expired for service releases long before this issue to be reported, so we do not have any plans to include this fix in Infragistics 12.1.
Please let me know if you have any further questions.
That workaround won't work for me, as this all happens in a batch process. Is there an plans to include the fix in 12.1? Upgrading to 13.1 would require code changes that we aren't able to make just yet
Hello,
The fix of this issue was included in the latest service release of Infragistics 13.1 and Infragistics 13.2. As workaround of this issue I could suggest you to open the file with Excel and then close it. When you open this file in MS Excel and they automatically fix it up, the original data in the WRITEACCESS record is lost and it is overwritten with the default value (the current user). Other option is to upgrade to Infragistics 13.1 or Infragistics 13.2.
I hope that this will helps you.
I applied the latest patch (NetAdvantage_WPF_20121.2314_SR.zip). I get the same error message when opening the file. I'd like to send the file, so you can try it. Is there a way I can send the file without posting it to the forum? I'd rather not make it publicly available.
The way the system works, I'm not able to open and save the file before running the Excel code. It all happens in batch.
If you still get the same issue after applying the latest updates, try the following: Open the file in Excel and save it to a new filename preferably as an xlsx workbook.
We've seen this same error message with 13.1 as well, but it has a logical explanation: The spreadsheet we were trying to process was produced by an old in-house Access export that was producing Excel 97 files. Once we save the export to an Excel 2007 or later format, the error doesn't happen.
Hoppe this helps.