Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Tue Jan 21, 2020 8:16 pm

Hi,

We have a console application that handles some fairly large files that we open using code like this:

using (Spire.Xls.Workbook workbook = new Spire.Xls.Workbook())
{
workbook.LoadFromFile(FilePath);
}

This has been working just fine. However, we just got a .xlsx file that is about 288 MB in size, which is big, but not crazy big, and when we run LoadFromFile, it throws an exception: "Stream was too long". We have the licensed version of Spire.XLS version 9.5.2.6040.

Is there something we can do to fix this?

Thanks.

tomwardatl@gmail.com
 
Posts: 9
Joined: Mon Jan 07, 2019 7:18 pm

Wed Jan 22, 2020 6:58 am

Hello,

Thanks for your inquiry.
I simulated a 284MB Excel file and tested it with the latest Spire.XLS Pack(Hotfix) Version:10.1.8, but didn't encounter any issue. I suggest you download the latest version and try again, since it contains more bug fixes than the old versions. If the issue still happens, please provide your input file for further investigation. You could upload it to the DropBox or OneDrive and then share the download link with us. Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Jan 23, 2020 3:54 pm

I have created a version of the file that still gives me the error, even with your new hotfix version. Do you have a DropBox or other location where I can upload the file?

tomwardatl@gmail.com
 
Posts: 9
Joined: Mon Jan 07, 2019 7:18 pm

Thu Jan 23, 2020 4:05 pm

I uploaded the file to my Google Drive, and sent you the details in an email. Please let me know if you got the file OK.

tomwardatl@gmail.com
 
Posts: 9
Joined: Mon Jan 07, 2019 7:18 pm

Fri Jan 24, 2020 3:00 am

Hello,

Thanks for your sharing.
I have downloaded your file and indeed found it would throw the OutOfMemoryException when loading the file. This issue has been logged into our bug tracking system with the ticket SPIREXLS-2075. If there is any update, I will inform you.
Btw, our Dev team is on Chinese Spring Festival holiday from 24/1/2020 to 30/1/2020, and they will work on this issue once they get back to the office. Apologize for the delay and inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Mar 02, 2020 2:26 pm

Any update on this bug?

tomwardatl@gmail.com
 
Posts: 9
Joined: Mon Jan 07, 2019 7:18 pm

Tue Mar 03, 2020 3:19 am

Hello,

Thanks for your following up.
I got news from our Dev team that since your Excel file is too large, reading its full data requires 2.2G of space, that exceeds the maximum allocable space of the stream (2 ^ 31-1 =2147483647). Sorry we cannot process it. Hope you could understand.
If there is anything else we can do for you, just feel free to contact us.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Mar 05, 2020 3:24 pm

I'm trying to understand what is going on with this file. It is 288 MB, but it takes ten times that much (2.2 GB) to load the file using Spire?

It has about 600,00 rows and 93 columns, which is fairly big, but not a ridiculously large file.

Is there anything we can do to be able to open the file? Do you have some kind of workaround for me? This file opens in Excel with no problems.

tomwardatl@gmail.com
 
Posts: 9
Joined: Mon Jan 07, 2019 7:18 pm

Fri Mar 06, 2020 2:24 am

Hello,

Thanks for your response.
I used the 7zip to expand your Excel file, the expanded file size is 2.08G, as shown in the attached screenshot. As I mentioned before, this exceeds the maximum allocable space of the stream. Thus, it would throw the OutOfMemoryException. Sorry at present we don't have any good solution for you.

Sincerely,
Rachel
E-iceblue support team
Attachments
20286.png
20286.png (45.17 KiB) Viewed 2926 times
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Fri Mar 06, 2020 7:35 pm

No, something is very wrong here. Please see the attachments.

The file is about 290 MB, both as a stand-alone file and in the zip file. Can you use WinRar to extract it?
Attachments
TomWardNoConnections Excel File Extracted.png
This is the Excel file after it has been extracted, also 290 MB
TomWardNoConnections Excel File Extracted.png (3.63 KiB) Viewed 2916 times
TomWardNoConnections Excel File.png
This is the Excel file, which is 290 MB
TomWardNoConnections Excel File.png (41.62 KiB) Viewed 2916 times
TomWardNoConnections Zip File.png
This is the zip file, which is 283 MB
TomWardNoConnections Zip File.png (4.07 KiB) Viewed 2916 times

tomwardatl@gmail.com
 
Posts: 9
Joined: Mon Jan 07, 2019 7:18 pm

Mon Mar 09, 2020 3:51 am

Hello,

Sorry for the late reply as weekend.
Maybe my previous reply caused you some misunderstanding. I just used 7zip to unzip/extract your .xlsx format file (TomWardNoConnections.xlsx), rather than unzipping your .zip format file (TomWardNoConnections.zip), as shown in the attached screenshot. You could install the 7zip and then verify it on your side.
If there is still any question, please feel free to contact us.

screenshot.png
screenshot.png (14.99 KiB) Viewed 2849 times

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Mar 09, 2020 3:10 pm

I'm sorry, but I don't understand what is going on.

You said, "I just used 7zip to unzip/extract your .xlsx format file, rather than unzipping your .zip format file" It seems like these are the same thing. No matter how you do it, you have to get the .xlsx file out of the zip file. I asked in my last post, that you try it using WinRar. Did you do that?

In any case, I downloaded 7zip and used it to extract the file:

7ZipExtract1.png
Extracting the file using 7zip
7ZipExtract1.png (30.8 KiB) Viewed 2835 times


Here is the results after it has been extracted. In all cases, using WinZip or WinRar or 7zip, the .xlsx file is about 290 MB, not 2 GB.

7ZipExtract2.png
After the file has been extracted
7ZipExtract2.png (3.44 KiB) Viewed 2835 times


Please try this again in some way, so that you get a .xlsx file that is about 290 MB. Once you have that file, please explain why workbook.LoadFromFile(FilePath); is not able to open it.

TomWardCredigy
 
Posts: 2
Joined: Mon Mar 09, 2020 1:43 am

Mon Mar 09, 2020 3:30 pm

I have put a new version of the .xlsx file itself to my Dropbox. It has the same password as before, but this time, it's on the .xlsx file itself (not a zip file). Please see the email I just sent.

Please verify that this file is about 290 MB, and then try to open it.

Tom Ward

TomWardCredigy
 
Posts: 2
Joined: Mon Mar 09, 2020 1:43 am

Tue Mar 10, 2020 7:47 am

Hello,

Sorry, maybe my previous explanation is not clear enough.
For your newly uploaded file, after downloading, its size is 289MB. I removed its password and re-saved it as an Excel file named "TomWardWithoutPassWord.xlsx". Then, I used 7zip to extract the file "TomWardWithoutPassWord.xlsx" and got the folder "TomWardWithoutPassWord".
This folder contains the internal data of an Excel file, and our loading method is also based on this data. The size of this folder is 2.08G which exceeds the maximum allocable space of the stream (2147483647 bytes). You can refer to my attached screenshot. Hope you can understand.

Screenshot.png
Screenshot.png (55.22 KiB) Viewed 2810 times

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS