Free Support Forum -

Cell HtmlString Question


I’m trying to use HtmlString to properly put Html code in a cell but it seems that it’s doing some sort of preprocessing of Html code and removes almost all tags and keeps a very limited set of properties.
It seems it doesn’t understand tags or or “font-size:large;” style attribute.

For this html put in HtmlString property:
<span style=“font-size: large;”>
<span style=“font-family: Comic Sans MS;”>memo Body title

memo Body simple

<span style=“color: rgb(255, 0, 0);”>red

I get the following processed html after the assignation:

<Font Style=“FONT-FAMILY: Comic Sans MS;FONT-SIZE: 10pt;COLOR: #000000;”>memo Body title
<Font Style=“FONT-FAMILY: Arial;FONT-SIZE: 10pt;COLOR: #000000;”>memo Body simple
<Font Style=“FONT-FAMILY: Comic Sans MS;FONT-SIZE: 10pt;COLOR: #ff0000;”>red

Is there a way to stop this preprocessing and use my Html instead of the processed one?
Anything more that a bold, font or color doesn’t seem to work.




Well, Aspose.Cells is mainly an MS Excel spreadsheet management library, it can read and write HTML files but those HTML files are more like MS Excel oriented rather than general/common HTMLs. It can also parse HTML tags using Cell.HtmlString attribute. But, parsing all types of HTML tags / files (with all its flavors) is not its strong feature by any means.

Could you give us your sample code (runnable) with your important / desired HTML tags set into its HtmlString attribute to show the issue, we will check it soon if we can support your most demanded tags.
Also, provide your sample files (input, output etc.)

Thank you.


regarding the features I (and others) might need are a few symbols that aren’t parsed when using HtmlString, here is a small list of symbols I think they aren’t parsed:

’ ‘ … € ‹ › œ Ÿ ‚ ƒ „
… † ‡ ˆ
‰ Š Œ “
” • – — ˜
™ š ≠ ≤ ≥ ∞ ‚ ƒ „ …
† ‡ ˆ ‰
Š ‹ Œ ‘
’ “ ” • –
— ˜ ™ š
› œ Ÿ &masr; &Ecric;

Many symbols aren’t very useful but I think all of them are mandatory.
For example “€” “’” “‘” are highly used symbols.

(Some symbols in the above sequence might appear twice)


Thanks for providing us the list of your desired symbols chars.

These symbols chars are not supported in HtmlString attribute of Cell. We need to check if we can support the chars/symbols.

I tried using the following code but it does not render the symbols rather take it as text.

Sample code:
Workbook wb = new Workbook();

Worksheet ws = wb.Worksheets[0];

Aspose.Cells.Cells cell = ws.Cells;

cell[0, 0].HtmlString = "

’ ‘ … € ‹ › œ Ÿ ‚ ƒ „… † ‡ ˆ‰ Š Œ “” • – — ˜™ š ≠ ≤ ≥ ∞ ‚ ƒ „ …† ‡ ˆ ‰Š ‹ Œ ‘’ “ ” • –— ˜ ™ š› œ Ÿ &masr; &Ecric;";


I have logged a ticket with an id "CELLSNET-41491" for your case. We will look into it soon.Once we have any update on it, we will let you know here.

Thank you.


Please try the new fix/version: Aspose.Cells for .NET v7.4.1.4.

Your issue should be fixed in it.

Also, we
could not find the chars about "
&masr; "
and “

Please tell us which chars/symbols are these
two strings?


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

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