Copy worksheet does not work

Hi,


I do have a template excel file which does contain a worksheet with a camera area.
If I copy this worksheet in an excel 97 file everythink works.
If I try it with an excel 2007 file I do get a corrupted excel file.
PFA a solution to reproduce this behaviour.

int iDesign = wb.Worksheets.AddCopy(“Designer”);
Worksheet wsDesigner = wb.Worksheets[iDesign];
wsDesigner.Name = “Copy”;

Best regards
Hi,

I can find the issue as you have mentioned. The output file is corrupted and MS Excel displays errors when opening the file into it.

I have logged a ticket with an id: CELLSNET-40157. we will look into it soon.

Thank you.

Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.0.3.6

Hi,


thank you for that bug fix.But I have found another one.
If I open the template file in XLS format and save it in XLSX format the camera area will be converted into a normal picture.

Workbook wb = new Workbook(System.IO.Path.Combine(Application.StartupPath, “template.xls”));
wb.Save(System.IO.Path.Combine(Application.StartupPath, “test.xlsx”), SaveFormat.Xlsx);

Best regards

Hi,


It works fine, I opened/used your “template.xls” file from your previous project to save it as “mytest.xlsx” (attached), see the code.

Workbook wb = new Workbook(@“E:\test2\copy_worksheet\WindowsFormsApplication2\bin\Debug\template.xls”);
wb.Save(@“E:\test2\copy_worksheet\WindowsFormsApplication2\bin\Debug\mytest.xlsx”, SaveFormat.Xlsx);

Could you give us your template files and also screen shot to point out the issue.

Thank you.

Hi,


Sorry. I haven´t described it well.
After the creation of mytest.xlsx you have to change the fields Source!B2 to for example “Changed value”. This value should now be shown on the worksheet ‘Designer’ within the camera area.

Best regards
Christoph

Hi,


"After the creation of mytest.xlsx you have to change the fields Source!B2 to for example “Changed value”. This value should now be shown on the worksheet ‘Designer’ within the camera area."

If you could open your template “template.xls” file into Ms Excel and do the (change the cell B2 in the Source sheet, you will see that it also changes Designer sheet area(s). So, the re-saved file (by Aspose.Cells) does the same thing.

Thank you.

Hi,


I have changed the cell Source!B2 in both files (mytest.xlsx and template.xls).
Only in file template.xls the camera area is updated according to cell Source!B2.

Best regards

Hi,


Thanks for the files.

Now, I can notice the formula “=$L$4:$M$5” is gone for camera area in the “Designer” sheet after re-save (by Aspose.Cells). I have logged it and we will soon look into it.

Thank you.

Hi,


Please try the latest fix: Aspose.Cells for .NET v7.0.4.1, we have fixed your issue now.

Thank you.

Hi,


The open/save issues is fixed, but I have found another issue. If I open the workbook in xls format, copy the worksheet and then save it into xlsx format, the formula for the camera area in worksheet ‘copy’ is gone.

Best regards

Workbook wb = new Workbook(System.IO.Path.Combine(Application.StartupPath, “template.xls”));

int iDesign = wb.Worksheets.AddCopy(“Designer”);
Worksheet wsDesigner = wb.Worksheets[iDesign];
wsDesigner.Name = “Copy”;

wb.Save(System.IO.Path.Combine(Application.StartupPath, “test.xls”), SaveFormat.Xlsx);

Hi,

Since you are saving in xls format i.e test.xls, so please use SaveFormat.Excel97To2003 and not SaveFormat.Xlsx.

Let us know if it resolves your problem.

Hi,


Yes, you are right, we noticed this issue, I have reopened your issue again, we will figure it out soon.

Thank you.

Hi,

We have fixed this issue. Please download: Aspose.Cells for .NET v7.0.4.3

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.