We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Copy worksheets to other workbook using Aspose.Cells for .NET in C#

Hi,


First of all, I’m using the latest version of your Aspose.cells dll (8.7.0.0). Each time I try to copy the attached Excel workbook into a new workbook I get a CellsException.

I attach you to this post a sample project which shows the described issue. Please launch it and you will see the exception stack.

Let me know if you need further information.

Thanks,

Romain.

Hi,


Thanks for providing us sample project with template file.

After an initial test, I observed the issue as you mentioned by using your sample project with you template file. I found an exception “Invalid text of the defined name.” when copying worksheet.
e.g
Sample code:


Workbook targetWb = new Workbook();
Workbook srcWb = OpenWorkbook(srcPath);
for (int i = 0; i < srcWb.Worksheets.Count; i++)
{
Worksheet ws = srcWb.Worksheets[i];
int index = targetWb.Worksheets.Add();
targetWb.Worksheets[index].Copy(ws);//Exception occurred.
targetWb.Worksheets[index].Name = ws.Name;
}
targetWb.Save(targetPath);

I have logged a ticket with an id “CELLSNET-44225” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,


That is exactly what I got.

I hope you will fix it quickly.

Regards.

Hi,


Sure, we will try to figure your issue out in the next couple of weeks.

Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for using Aspose.Cells.

It is to inform you that we have fixed your issue CELLSNET-44225 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET (Latest Version) and let us know your feedback.

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


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

It works, thanks

Hi Romain,


Thank you for the confirmation. Please feel free to contact us back in case you need our further assistance with Aspose APIs.