Free Support Forum - aspose.com

Aspose.Cells 4.4.1.0 can't open then save some of SpreadsheeML files

static void Main(string[] args)
{
string filename = @"D:\export\test7.xml";
using (Stream s = new FileStream(filename, FileMode.Open))
{
Workbook wb = new Workbook();
wb.Open(s, FileFormatType.SpreadsheetML);
wb.Save(filename + ".xls", FileFormatType.Excel2003);
}
}

Using the code above with the SpreadsheetML file attached, the output file becomes corrupt and Excel 2003 strips out all the styling information. When saving as SpreadsheetML filetype instead, the saved file is reported to be corrupt and refueses to be opened by excel 2003.

Please note that the attached SpreadsheetML file attached opens fine on excel.

Could you find me a solution so that we can save the file as an Excel 2003 file type and be not corrupted and have retained the styles please?

Hi,

Thanks for the template file.

We will figure it out soon.

Thank you.

Hi,

Can I find out when the fix is expected please? (because on our side internally , the need for the fix is becoming more urgent)

Thanks

Hi,

Thanks for your tracking.

We will get back to you soon.

Thanks for being patient!

Hi,

Thanks for your patience.

Please try this fix.

In this fix,we use Cell.GetStyle and SetStyle method replace the property of Cell.Style.

If you want to set style of the cell, please change your codes as :

//Getting the style of the cell.

Style style = cell.GetStyle();

//Setting the property of the style.

.......

//Setting the style of the cell

cell.SetStyle(style);

It’s working well.



Thanks