Column and Row sizes not retained when opening file

Hi there

When I open an existing xls and then just save it back out, it loses all the column, row sizes that have been set in the spreadsheet. It defaults back to default cell sizes.

Workbook excel = new Workbook();

excel.LoadData(@"C:\ParsingTestFiles\Export.xls");

excel.Save(@"C:\ParsingTestFiles\Export_New.xls");

I need to edit the format styles of this doc but I need to retain the sizes that were set by our data team. We've just updated our license so I hope we can find a resolution.

Kind Regards

Chris

Hi Chris,

Thanks for considering Aspose.

Kindly use Workbook.Open() instead as Workbook.LoadData only loads data and some formattings might be lost as a result:

Kindly change your code to:

Workbook excel = new Workbook();

excel.Open(@"C:\ParsingTestFiles\Export.xls");

excel.Save(@"C:\ParsingTestFiles\Export_New.xls");

Thank you.

Excellent, that works.

Thank you for the quick response.