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.

Sat Mar 27, 2021 5:22 pm

Hi,
I'm using FreeSpire.xls 10.10.1 and I need some clarification about limitations.
I read from the website:
Free version is limited to 5 sheets per workbook and 200 rows per sheet. This limitation is enforced during reading or writing XLS or PDF files. From Free Spire.XLS v7.8, there is no any limitation when loading and saving .xlsx file forma


1) What about reading and writing .xlsm files ? Do they work as .xlsx files ?
It seems so to from the my test.

The limitation surely applies to .xls file formats, as I noted from my tests.
So I tried to convert some xls files to xlsx and xlsm with your library api ad with ExceInterop too.
They are loaded but when I try to access a sheet above 5 I got an error (something like 'Sheet ### not found')
Why ?

Further, If I convert the xls file to xlsx/xlsm from Excel , the converted files are properly handled by freeSpire
Why ?

Thanks for support

nda_tech
 
Posts: 12
Joined: Fri Jan 29, 2021 5:42 pm

Mon Mar 29, 2021 3:38 am

Hello,

Thanks for your inquiry.

1) As with .xlsx files, there is no any limitation when reading and writing .xlsm files.

2) For .xls files, it is limited 5 sheets per workbook during reading or writing. That is, if you load a .xls file with more than 5 sheets, you can only get the first 5 sheets. Therefore, when you try to access a sheet above 5, you will get an error or it will return null.

If there are any other questions, just feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Mar 29, 2021 5:36 am

Hi,

Thank you very much for the reply

For the point 1 It was very close what I experience and I excepted.

But for the point 2 my question is:
why if I convert the xls file to xlsx/xlsm from Excel , the converted files are properly handled by FreeSpire but if I converted It with Spire or ExcelInterop the converted XLSX/XLSM file won't work with FreeSpire ?

Thanks again

nda_tech
 
Posts: 12
Joined: Fri Jan 29, 2021 5:42 pm

Mon Mar 29, 2021 7:24 am

Hello,

Thanks for your response.
You mean that using our Spire.XLS to convert .xls files to .xlsx/.xlsm files, and then load the converted files, you will not be able to access a sheet above 5, right?

For the 5-sheet limit for .xls files, this means that if you convert a .xls file with more than 5 sheets to .xlsx/.xlsm with our Free Spire.xls, the converted file will keep only the first 5 sheets, other sheets will be removed. And if you convert the xls file to xlsx/xlsm from Microsoft Excel, all the sheets will be preserved . Hope you can understand.

If there are some misunderstandings, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Mar 29, 2021 7:46 am

Hi thanks for reply

Pretty sure FreeSpire keep only the first five sheet, but actually I'm using ExeclIterop do convert xls to xlsm and FreeSpire doesn't work with the converted files
FreeSpire loads the file but still doesn't access sheet after fifth ( says the sheet is missing but it exist for sure , I verified)

nda_tech
 
Posts: 12
Joined: Fri Jan 29, 2021 5:42 pm

Mon Mar 29, 2021 10:09 am

Hi
I find the issue.
I don't know why but I saved the converte file in Windows temporary folder and FreeSpire seems not to be able to open it, while saving into other non windows special folder, works fine

Sorry for the issue

Thanks
Nicola

nda_tech
 
Posts: 12
Joined: Fri Jan 29, 2021 5:42 pm

Mon Mar 29, 2021 10:12 am

Hello,

Thanks for your feedback.
According to your description, I used ExeclIterop to convert the .xls file to .xlsm, and then loaded the .xlsm file and accessed a sheet above 5 with our Free Spire.XLS, but did not encounter any issue. Below is my testing code.
Code: Select all
            Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
            Microsoft.Office.Interop.Excel.Workbook workBook = excelApp.Workbooks.Open(@"D:\test.xls");
            workBook.SaveAs(@"D:\test4.xlsx", Microsoft.Office.Interop.Excel.XlFileFormat.xlOpenXMLStrictWorkbook);
            workBook.Close();

            Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
            workbook.LoadFromFile(@"D:\test4.xlsx");
            Spire.Xls.Worksheet worksheet = workbook.Worksheets[5];
            string value = worksheet["A1"].Value;


To help us investigate further, please provide us with your test code and your .xlsm file converted by ExeclIterop. Thanks in advance.


Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Mar 29, 2021 1:28 pm

Hi,

has stated in my previous post I found that the issue isn't in the file but in the path where I saved it.
I was saving into Window temporary folder (some thing like
C:\Users\nicol\AppData\Local\Temp\frtqok54.xlsm
And FreeSpire fails .
The same file copied to or directly generated in other folder works fine with FreeSpire

Thank for your #1 support , for free users too :)

Thanks

Nicola

nda_tech
 
Posts: 12
Joined: Fri Jan 29, 2021 5:42 pm

Tue Mar 30, 2021 6:17 am

Hello Nicola,

Sorry for my mistake. I did not notice your previous post.
Anyway, I'm very glad to hear that you have found the cause. If you encounter any issues related to our products in the future, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.XLS