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

Free Support Forum - aspose.com

Problem while copying sheets in Excel 2007 (xlsm) format


I have found the following problems while copying sheets in Excel 2007 xlxm format for some sheets especially those that contains macros

1) Color formating is lost

2) Macros are not working in the copied sheet, but they are working in the original sheet

I have used the following code for copying the sheet in the workbook.

String inputFilePath = "C:\\excel.xlsm";

workbook.open(inputFilePath, FileFormatType.EXCEL2007XLSM );

Worksheets sheets = workbook.getWorksheets();


workbook.save(inputFilePath, FileFormatType.EXCEL2007XLSM );

Please verify the above issue and prove some solution for that.


Hi, Please also update us that is this problem is only with Excel 2007 macros

file (xlsm)? or the problem is with Excel 2003 and 2007 (xlsx) also.


We will look into your issue and get back to you soon.

We have already logged your issue with an id: CELLSJAVA-16870.

Thank you.


Please verify if the above problem is only with Excel 2007 macro file (XLSM) or the problem also persist with Excel 2003 (XLS) and Excel 2007 (XLSX) format.

When are we expected to get the fix/update for this issue? It is very urgent for us, we are losing lot of business for this feature.

If there is delay in fixed version relese, then please provide us with a earlier patch for this issue.



The issue is mainly due to the fact that some advanced features such as the gradient fill effect of Cell and some properties of drawing objects are not supported currently. We will try to provide a fix for your case in 1-2 days.
Moreover, such kind of issues are mainly with Excel2007 files because those advanced features are imported from Excel2007.

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version of Aspose.Cells. We have supported your requested feature.

Thank You & Best Regards,

We have tried the attached latest version of Aspose Cells. We have found the following observation:

  1. Size of original excel file is 4.87 MB (5,108,408 bytes)
  2. When we copy the file in step 1 using Apose, then its size changes to 3.02 MB (3,168,770 bytes)
  3. When we open the file generated in step 2 using Excel 2007 viewer then some cells contain “#####” values. (screen shots is attached for this)
  4. If we open the same file using Excel 2007 full version, then it opens correctly. Now if we save then file without doing any other changes, then the file size changes to 4.68 MB (4,915,910 bytes)
  5. Now if we open the file generated in step 4 by Excel 2007 viewer, then it opens correctly.
We have programmatically checked, all cells of original and both copies contain the same value, same color, same formula and same formula type.

Why are we not able to see correct values in Excel viewer for file generated in step 2 ? Why the file size changes? Are they exact copies or something is missing ?

Also when we copy a sheet of workbook using “sheets.addCopy(0);” method and then try to compare the original sheet with the copied sheet, then we found for many cells, the formula type ( cell.getFormulaType()) is different. We found for original sheet the formula type is 2 but for the copied sheet formula type is 0.

Other than that the cells value, color, formula are same, only formula type is different.

Can you please explain the reasons for that? Is there any side effect due to the changed formula type?


Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please share your template file and sample code with us to show the issue. We will check it soon and get back to you.

Thank You & Best Regards,

I am attaching two Excel 2007 xlsm files, Test1.xlsm and Test2.xlsm.

For File Test1.xlsm:
- Open Test1.xlsm file and save it with different name say Test1_copy.xlsm. Now open the Test1_copy.xlsm with Excel 2007 viewer, it will contains some cells with “######” value. If you open the same file with Excel 2007 full version then it will open correctly. Now if you save the file, and then open it with Excel 2007 viewer, then it will open correctly.
Also size of original file Test1.xlsm is 15.1 KB (15,508 bytes)
size of Test1_copy.xlsm is 12.4 KB (12,743 bytes)
size of Test1_copy.xlsm after opening and saving with excel full version =14.5 KB (14,938 bytes)

For Test2.xlsm:
- Open the file and copy the first sheet using “sheets.addCopy(0);” and save the file as Test2_copy.xlsm. Now if you compare the two sheets of Test2_copy.xlsm then the cells “C1, C2, C3, C4, C5, C6” contains different formula type in the two sheets of same workbook “Test2_copy.xlsm”.

Please provide the solutions for the both problems asap.


Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for sharing the template files and details about your issue.

We will further investigate your issue and get back to you soon.

Thank You & Best Regards,

Please let us know about the progress of the issue and when will we get a fix for that.



We are working on your issues and will provide a fix for it in 1-2 days hopefully.
Thank you.


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please try the attached latest version. We have fixed the issue of "####" in Excel Viewer and the issue of formula type.

Thank You & Best Regards,

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

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