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.

Mon May 01, 2023 6:46 pm

Good Afternoon,

I am attempting to load an xls file that we have received from a client to read the contents but the "LoadFromFile()" method continues to crash. I have attempted to define every Excel version available to me but it does not make any difference. I have also tried to load the document without an excel version, but it also crashed. Each time it crashed I received the above error message from the Spire library.

I am running with Spire.XLS version 13.4 inside of a WinForms application using the .Net Framework 4.6.2. I am unable to send a copy of the excel document (as it contains proprietary client data). I am in the US region and I am using the English (United States) language pack on Windows 11 Business.

The file extension is .xls and when I open the file with Excel I do get the "The file format and extension of <fileName> don't match." message. I was able to process this file using the Excel interop, but I am hoping there is a solution you might be able to point me towards for this problem.

Thank you!

Bandonia
 
Posts: 34
Joined: Tue Nov 16, 2021 9:40 pm

Tue May 02, 2023 10:22 am

Hello,

Thank you for your inquiry.
Based on your description, I simulated an Excel file in xls format and loaded it using our latest Spire.Xls 13.4.0, but I did not reproduce your issue. For your situation, you can send us your files via email([email protected]) to help us investigation further.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 454
Joined: Mon Dec 27, 2021 2:23 am

Tue May 02, 2023 5:53 pm

Hello,

It turns out the file we are receiving is actually an xml file renamed to be .xls.

I have switched to use the LoadFromXml() method and I can load the file. However I am now having a different issue where a value marked as a "Number" in the xml is being converted to a date by the Spire library. Is there a way to prevent this from happening?

Thank you!

Bandonia
 
Posts: 34
Joined: Tue Nov 16, 2021 9:40 pm

Wed May 03, 2023 10:27 am

Hi,

Thanks for your feedback.
Could you please provide us with your document? So that we can do a further investigation and work out a solution for you. You can send it to us via email ([email protected]) or attach it here. Thanks for your assistance.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Thu May 04, 2023 3:06 am

Hi,

Thanks for your sharing. I reproduced your issue and logged this issue into our issue tracking system with the ticket number SPIREXLS-4645, our developers will investigate and fix it. Sorry for the inconvenience caused. Once there are any updates available, I will inform you asap.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Tue May 09, 2023 8:47 pm

Good Afternoon,

I was just wondering if there was any update on the ticket created above?


Thank you

Bandonia
 
Posts: 34
Joined: Tue Nov 16, 2021 9:40 pm

Wed May 10, 2023 1:25 am

Hi,

Thanks for your following-up.
I am pleased to inform you that we have submitted the issue to our testing phase, and our team is currently conducting tests. Once there are any updates available, I will let you know asap.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon May 15, 2023 7:58 pm

Good Afternoon Triste,

I am just following up on the ticket that was created for the issue above. My apologies for the new post but I am attempting to move forward with a project and am unable to do so until this issue has been resolved.

Thank you!

Bandonia
 
Posts: 34
Joined: Tue Nov 16, 2021 9:40 pm

Tue May 16, 2023 3:00 am

Hi,

Thanks for your following-up.
I have given this issue the highest priority and urged our testing team speed up this test process, once the test is passed, our testing team will release the new version. Please rest assured that we are working on resolving this problem as soon as possible. Thanks for your patience and understanding.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Wed May 31, 2023 4:07 pm

Good Day Triste,
My apologies for yet another message, but I was wondering if there is any update on the above ticket?

Thank you!

Bandonia
 
Posts: 34
Joined: Tue Nov 16, 2021 9:40 pm

Thu Jun 01, 2023 10:13 am

Hi,

Thanks for your patience.
Glad to inform you that we just released spire.Xls_13.5.6 hotfix, which has fixed your issue SPIREXLS-4645. The value type is numeric, Our developers have adjusted the code for obtaining the data, see the following code for reference.
Code: Select all
CellRange cellRange = wb.Worksheets[0].Range["C13"];
string text = cellRange.DisplayedText;

Please download from the following links and have a test.
Website: https://www.e-iceblue.com/Download/download-excel-for-net-now.html
Nuget: https://www.nuget.org/packages/Spire.XLS/13.5.6

If there are any further concerns or questions, jsut feel free to contact us!

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Fri Jun 09, 2023 7:51 pm

Good Afternoon Triste,
I have downloaded the latest version of the library from Nuget and we currently use the 'ExportDataTable' method on the worksheet to import data from our extracts. This call still returns the issue I was seeing before. We use this method as our client extracts are quite large and this method worked much better than traversing the file manually.

I have tried to provide the ExportOptions object and to use the 'KeepDataFormat' property. I tried both true & false, I am still getting a date returned for the numbers in my extract (a copy of which I sent previously).

I do not want to revert to a manual approach, as this will slow down our import processes significantly. Is there something I can do with the 'ExportDataTable' call to make this work?

Thank you

Bandonia
 
Posts: 34
Joined: Tue Nov 16, 2021 9:40 pm

Mon Jun 12, 2023 10:06 am

Hi,

Thanks for your feedback.
We have investigated the problem and reviewed the data parsing functionality. However, when we tested it, we did not find any issues with the values being parsed as dates.
debug.png
debug.png (68.25 KiB) Viewed 1106 times

We would like to request that you provide us with your testing code so that we can further investigate the issue.
Once we receive your testing code, we will conduct additional tests to determine the root cause of the problem and provide a solution to the issue promptly.
Thank you for your cooperation and understanding in this matter.
Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.XLS