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

Free Support Forum - aspose.com

Wrong styles when save to HTML with css prefix


I have some problems when I try save Workbook to HTML file with seted “CellCssPrefix” in HtmlSaveOptions.
The problem is that class name in HTML is without prefix, but in CSS styles prefix is correct. But it is only (in my case) for span element with changed style. For cell class are set properly. I attached pictures showing the problem and Excel file. To reproduce my case, I attached my code.

var workbook = new Workbook(@“D:\test.xlsx”);
workbook.Worksheets[0].Cells[“M4”].Characters(0, 10).Font.Color = Color.Red;
workbook.Save(@“D:\test.html”, new HtmlSaveOptions(SaveFormat.Html)
CellCssPrefix = “cssPrefix”


Thanks for the sample files and screenshots.

After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found some wrong styles when saving to HTML file format with css prefix. The problem is that class name in HTML is without prefix as per your screenshots, but in CSS styles, prefix is correct. I have logged a ticket with an id “CELLSNET-45306” for your issue.

We will look into it soon. Once we have an update on it, we will let you know here.

Thank you.

Thanks for using Aspose.Cells.

Please download and try the following latest fix

Aspose.Cells for .NET v17.4.5 (.NET 2.0) compiled in .NET Framework 2.0.
Aspose.Cells for .NET v17.4.5 (.NET 4.0) compiled in .NET Framework 4.0.

and let us know your feedback.


I have checked new fix and everything it’s ok now. Thank you for help :slight_smile:

Thanks for sharing good news with us and using Aspose.Cells.

We are pleased to know that your issue is resolved with the latest fix. Let us know if you encounter any other issue, we will be glad to look into it and help you further.

The issues you have found earlier (filed as CELLSNET-45306) have been fixed in Aspose.Cells for .NET 17.5.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.