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 30, 2019 9:49 am

Hello,

We are trying Spire.Xls 9.7 for use in our products.
And I found the issue.

The named cell 'NAMED CELL' is defined in 'Sheet2' of 'template.xltx', that a referenced from the cell of 'Sheet1'.
Run the following code on this file.
Code: Select all
using (var workbook = new Workbook())
{
   workbook.LoadTemplateFromFile("./template.xltx");
   workbook.Worksheets["Sheet2"].Remove();
   workbook.SaveToFile("./issue.xlsx");
}


The generated "issue.xlsx" be opened in Excel, warned that it contains links to external files.
When checking the definition of the name with Ctrl + F3, the value of 'NAMED_CELL' is '{...}' and the reference range is '#REF!$B$2'.
This behavior is different from Excel, open 'template.xltx' in Excel and manually delete 'Sheet2', and the value of 'NAMED_CELL' is '#REF!', Reference range is '#REF! #REF!' And no warning.

I want to get the same result as Excel.
Thanks in advance.
Attachments
25333_xlsFiles.zip
File used for test
(13.45 KiB) Downloaded 159 times

nf64
 
Posts: 24
Joined: Fri Aug 17, 2018 1:45 am

Tue Jul 30, 2019 10:51 am

Hello,

Thanks for your inquiry.
I did notice the behavior you described after removing the whole sheet2. The issue has been posted to our Dev team for further investigation. If there is any update, I will inform you. Sorry for the inconvenience caused.
Besides, if you just delete the range from sheet2, there will be no problem. The behavior of the result is same as MS Excel. You could refer to the following code to have a test.
Code: Select all
Workbook workbook = new Workbook();
workbook.LoadTemplateFromFile("template.xltx");
Worksheet sheet = workbook.Worksheets["Sheet2"];
CellRange range = sheet.Range["B2"];
sheet.DeleteRange(range, DeleteOption.MoveUp);
workbook.SaveToFile("result.xlsx",ExcelVersion.Version2013);

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Mon Aug 05, 2019 8:16 am

Hello,

Thanks for your reply.

Because I need to remove 'Sheet2', that means is unusable.
The same problem occurred when added code to remove the sheet.
Code: Select all
Workbook workbook = new Workbook();
workbook.LoadTemplateFromFile("template.xltx");
Worksheet sheet = workbook.Worksheets["Sheet2"];
CellRange range = sheet.Range["B2"];
sheet.DeleteRange(range, DeleteOption.MoveUp);

sheet.Remove(); // Added

workbook.SaveToFile("result.xlsx",ExcelVersion.Version2013);

I will wait for this problem to be fixed.

nf64
 
Posts: 24
Joined: Fri Aug 17, 2018 1:45 am

Mon Aug 05, 2019 8:43 am

Hi,

Yes, the issue still occurred after adding code to remove the sheet. Our Dev team will look into your issue, once there is any significant progress, I will notify you.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Thu Aug 15, 2019 9:37 am

Hi,

Glad to inform that the reported issue has been solved in Spire.XLS Pack(Hotfix) Version:9.8.5. Please download the hotfix from following link:
Our website: https://www.e-iceblue.com/Download/download-excel-for-net-now.html
NuGet: https://www.nuget.org/packages/Spire.XLS/

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Fri Aug 16, 2019 2:35 am

Hello,

We have confirmed that this problem has been resolved using Hotfix 9.8.5.
Thank you for prompt response.

nf64
 
Posts: 24
Joined: Fri Aug 17, 2018 1:45 am

Fri Aug 16, 2019 2:51 am

Hi,

Thanks for your feedback.
If there is anything we can do for you in the future. Please do not hesitate to contact us.
Wish you a wonderful day!

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.XLS