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 Oct 24, 2022 1:36 pm

Hi,
I have application where getting Cells.Count() value doesn't finish in specific sheet in Excel file using Spire.Officefor.NETStandard library 7.10.0.
I tried on computer with 8 GB of RAM (2 GB is free) and RAM memory is full during Cells.Count() call, it looks like that line of code will never finish.

This is the code I used for testing:
Code: Select all
 Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
            workbook.LoadFromFile(@"C:\1.xlsx");
            int sheet4CellsCount = workbook.Worksheets[4].Cells.Count();


I sent an example of excel file to [email protected].

Can you take a look at this?

Thanks,
Filip

filipfilipfilip
 
Posts: 45
Joined: Mon Jun 14, 2021 10:27 am

Tue Oct 25, 2022 9:53 am

Hello,

Thanks for your inquiry.
I didn’t find excel file in the email you sented. And I simulated a excel file to test your scenario and didn’t reproduce it.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Tue Oct 25, 2022 11:23 am

Hi,
I have now sent the excel file.
Best regards,
Filip

filipfilipfilip
 
Posts: 45
Joined: Mon Jun 14, 2021 10:27 am

Wed Oct 26, 2022 10:17 am

Hello,

Thanks for your feedback.
I did reproduce your issue, the issue currently can't be solved according to the feedback from our development team. However, you can use the following code to get the count of cell.

Code: Select all
int sheet4CellsCount = workbook.Worksheets[4].AllocatedRange.CellsCount;


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.XLS