The Excel file created in MS Office 2003 can not be saved as .xlsm or .xlmx file

The Excel file created in MS Office 2003 can not be saved as .xlsm (2007 format) or .xlmx (2010 format) file.

Simple code:

string fileName = GetPathFile() + “2003.xls”;<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><o:p></o:p>

string fileName2007Out = form11.GetPathFile() + “2007Out.xls”;<o:p></o:p>

Aspose.Cells.Workbook wb = new
Aspose.Cells.Workbook(fileName);<o:p></o:p>

try<o:p></o:p>

{<o:p></o:p>

Aspose.Cells.Workbook
wb = new Aspose.Cells.Workbook(fileName);<o:p></o:p>

if (File.Exists(fileName))<o:p></o:p>

{<o:p></o:p>


wb.Open(fileName);<o:p></o:p>


wb.Save(fileName2007Out, SaveFormat.Xlsm);<o:p></o:p>

// or wb.Save(fileName2010Out, SaveFormat.Xltx);<o:p></o:p>

wb = null;<o:p></o:p>

}<o:p></o:p>

}<o:p></o:p>

catch (Exception
ex)<o:p></o:p>

{<o:p></o:p>

string str
= ex.Message;<o:p></o:p>

}

File 2003.xls attached.

Can you help us?

Hi,

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

I was able to replicate this issue using the latest version:
Aspose.Cells
for .NET v7.2.0.5

with the following code.

I get the following exception.

We have logged this issue in our database. Development team will look into this issue. Once the issue is resolved or we have some update relating to it, we will let you know asap.

This issue has been logged as CELLSNET-40657.

C#


string filePath = @“F:\2003.xls”;


Workbook workbook = new Workbook(filePath);

workbook.Save(filePath + “.out.xlsm”);


Exception:
An unhandled exception of type 'System.ArgumentException' occurred in Aspose.Cells.dll

Additional information: Item has already been added. Key in dictionary: 'C:\DOCUME~1\IHATUK~1\LOCALS~1\Temp\images\spacer.gif' Key being added: 'C:\DOCUME~1\IHATUK~1\LOCALS~1\Temp\images\spacer.gif'

Screenshot:

The exception is the same. Thank you for quick response!

Hi,

Please try the new fix v7.2.0.6 we have fixed your issue now.