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 Jul 12, 2022 3:07 am

Dear Spire,

I am looping a list of saved excel files and it's terminate with ambiguous error when trying to load a file (not first one), I would like to know how to get actual error it hits when it trying to load that file.

Workbook sworkbook = sworkbook.LoadFromFile(tmpfilepath);

And the error I get as below:
Exception.Message : Value should be greater than zero and less than count of worksheets.
Parameter name: DisplayedTab

Exception.StackTrace : at Spire.Xls.Core.Spreadsheet.XlsWorkbook.set_DisplayedTab(Int32 value)
at spr᠁.ᜀ(XmlReader A_0, RelationsCollection A_1, spr៏ A_2, String A_3, Stream A_4, Stream A_5, List`1& A_6, Stream A_7)
at spr៏.ᜀ(List`1& A_0)
at spr៏.ᜁ(List`1& A_0)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(Stream A_0, String A_1)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(Stream A_0, String A_1, ExcelVersion A_2, ExcelParseOptions A_3)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.ᜀ(String A_0, String A_1, ExcelVersion A_2, ExcelParseOptions A_3)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook..ctor(sprជ A_0, Object A_1, String A_2, ExcelParseOptions A_3, Boolean A_4, String A_5, ExcelVersion A_6)
at spr឴.ᜀ(Object A_0, String A_1, ExcelParseOptions A_2, Boolean A_3, String A_4, ExcelVersion A_5)
at spr᡺.ᜀ(String A_0, ExcelParseOptions A_1, Boolean A_2, String A_3, ExcelVersion A_4)
at Spire.Xls.Workbook.LoadFromFile(String fileName, ExcelVersion version)...


Additional Info:
The Spire version I am working with is 8.10.2.6035
The excel file to be loaded was saved using workbook.SaveToFile(fullpath, ExcelVersion.Version2016); (and I can view the file using Ms Excel)

Best Regards,
Shyan

mshyan_spire
 
Posts: 11
Joined: Tue Jul 12, 2022 2:50 am

Tue Jul 12, 2022 8:25 am

Hi,

Thank you for your inquiry.
Based on the exception message you provided, it is difficult for us to determine your problem. Currently, our latest version is Spire.XLS Pack(Hotfix) Version:12.6.1. I suggest you download the latest version and try it out. If the issue still exists, please provide the following information for further investigation. You can attach your file here or send it to us via email (support@e-iceblue.com). Thanks in advance.
1) Your excel documents.
2) Test environment, such as win10, 64bit.
3) Application type, such as Console App, .NET Framework 4.8.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Wed Jul 13, 2022 1:30 am

The problem solved with latest Spire version.

Thanks and regards,
Shyan
Last edited by mshyan_spire on Wed Jul 13, 2022 3:56 am, edited 1 time in total.

mshyan_spire
 
Posts: 11
Joined: Tue Jul 12, 2022 2:50 am

Wed Jul 13, 2022 3:33 am

Hi,

Glad to hear that! If you encounter any issues related to our products in the future, please feel free to contact us.
Wish you all the best :D

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.XLS