Range.CopyData() method keeps the hyperlink original location

Hello,


I have attached an xlsx file. The code that I’m running is the following:

var excelDocument = new Workbook(“C:\1.xlsx”);
var worksheet = excelDocument.Worksheets[0];
var sourceRange = worksheet.Cells.CreateRange(0, 0, 3, 3);
var tempWorksheet = new Workbook().Worksheets[0];
var destinationRange = tempWorksheet.Cells.CreateRange(3, 1, 3, 3);

destinationRange.CopyData(sourceRange);
destinationRange.Copy(sourceRange, new PasteOptions { SkipBlanks = false, PasteType = PasteType.All });
destinationRange.CopyStyle(sourceRange);
destinationRange.Worksheet.Workbook.Save(“C:\test.xlsx”, SaveFormat.Xlsx);

If you run the code you will see that in the resulting file, the location of the hyperlink is the same as in the source file(A1 cell), but the range is moved to the desired location(B4:D6).

Thank you,
George Radu
Software Developer
IBM Romania

Hi George,

Thanks for your posting and using Aspose.Cells.

Please download and try the latest version: Aspose.Cells
for .NET v8.4.2.7
it should fix your issue.

I have tested your code with the latest version and it generated correct output excel file. I have attached the output excel file for your reference.

Hello,


Can you please attach the latest version for .Net framework 3.5?

Thank you,
George Radu
Software Developer
IBM Romania

Hi,


Please download and try our latest version/fix: Aspose.Cells for .NET v8.5.0, we have released it now, you may download it here:
http://www.aspose.com/community/files/51/.net-components/aspose.cells-for-.net/entry635784.aspx

You may get your desired .NET framework 3.5 compiled version of the product @ its installation location once you install the product on you pc.

Thank you.

Hello,

Can you please check again this issue? seems it’s present again in version 8.8.0.0.


Thank you,
Adriana Minea
Software Developer
IBM Romania

Hi,

Thanks for your posting and using Aspose.Cells.

I have tested this issue with the latest version: Aspose.Cells for .NET 8.8.0 using your sample code and found output excel file is correct. I have attached it for your reference. Do you see any issue with it? Please clarify.