Move Worksheet invalidates Named Ranges

I found that moving an earlier worksheet past a worksheet with named ranges invalidates the named range. I created a blank document in Excel 2010 and deleted all but one worksheet. Cell B1 I named as “thisone” and cell A1 had a formula “=thisone”. I saved the file as “C:\test1.xlsx”. Then I ran the below routine using Aspose Cells .NET 7.4.3.


Test2 was fine but Test3 and Test4 now had a #NAME? error in cell A1. It appeared that the Range still existed but was now referenced to a different worksheet.



Dim objBOOK = New Aspose.Cells.Workbook(“C:\test1.xlsx”)
Dim objNEWSHEET = objBOOK.Worksheets(objBOOK.Worksheets.Add())
objNEWSHEET.MoveTo(0)
objBOOK.Save(“C:\test2.xlsx”, Aspose.Cells.SaveFormat.Xlsx)
objNEWSHEET.MoveTo(objBOOK.Worksheets.Count - 1)
objBOOK.Save(“C:\test3.xlsx”, Aspose.Cells.SaveFormat.Xlsx)

objBOOK = New Aspose.Cells.Workbook(“C:\test2.xlsx”)
objNEWSHEET = objBOOK.Worksheets(0)
objNEWSHEET.MoveTo(objBOOK.Worksheets.Count - 1)
objBOOK.Save(“C:\test4.xlsx”, Aspose.Cells.SaveFormat.Xlsx)

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

Please provide us the source and output documents used in your code to investigate this issue. We will check them at our end and if we found any issues, we will fix them.

The Test1.xlsx file is the Source. The Test2, Test3, and Test4 were generated from Aspose Cells for .NET using to the below source code.


Public Shared Sub Main()
Dim objBOOK = New Aspose.Cells.Workbook(“U:\test1.xlsx”)
Dim objNEWSHEET = objBOOK.Worksheets(objBOOK.Worksheets.Add())
objNEWSHEET.MoveTo(0)
objBOOK.Save(“U:\test2.xlsx”, Aspose.Cells.SaveFormat.Xlsx)
objNEWSHEET.MoveTo(objBOOK.Worksheets.Count - 1)
objBOOK.Save(“U:\test3.xlsx”, Aspose.Cells.SaveFormat.Xlsx)

objBOOK = New Aspose.Cells.Workbook(“U:\test2.xlsx”)
objNEWSHEET = objBOOK.Worksheets(0)
objNEWSHEET.MoveTo(objBOOK.Worksheets.Count - 1)
objBOOK.Save(“U:\test4.xlsx”, Aspose.Cells.SaveFormat.Xlsx)
End Sub 'Main

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We were able to replicate your issue with the latest version. Test3 and Test4 has invalid named range because of moving worksheet. We have logged this issue in our database. We will look into your issue and fix it. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSNET-41645.

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have fixed the issue.

Please download and try this fix: Aspose.Cells for .NET v7.4.3.2 and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-41645) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.