Using ImportTableOptions isHtmlString prop is not outputting links correctly

I am inserting rows into a worksheet using the ImportTableOptions() feature. Some of my columns contain html text, and when I set IsHtmlString to true, that text is successfully converted. However, when the text contains an anchor tag, the link is formatted as regular text and is not clickable in the cell. Please see below:

example html string:

<a href=“”>CN Risk 3 


import table options:
var imp = new ImportTableOptions();
imp.InsertRows = true;
imp.IsFieldNameShown = false;
imp.IsHtmlString = true;

output in excel:
image.png (8.7 KB)


Please notice, I am able to reproduce the issue as you mentioned. I found ImportTableOptions.IsHtmlString property is not inserting hyperlinks correctly. I used the following sample code to import the data into Excel spreadsheet. But in the output file, simple text is added instead of hyperlinked text:
Sample code:

            DataTable table = new DataTable();
            table.Columns.Add("Start Time");
            string[] addrow = { "1", "<p><a href=\"\">CN Risk 3</a>&nbsp;</p>", "1:00 PM" };

            var workbook = new Workbook();
            var ws = workbook.Worksheets[0];
            ws.Cells.ImportData(table, 0, 0, new ImportTableOptions
                IsFieldNameShown = true,
                ConvertNumericData = true,
                NumberFormats = new string[] {null, null, "h:mm AM/PM"},
                IsHtmlString = true


I have logged a ticket with an id “CELLSNET-50380” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.

1 Like


This is to inform you that your issue has been resolved. The fix will be included in our upcoming release, Aspose.Cells for .NET 22.3. The next release will be released in the second week of March, 2022. You will also be notified when a new release is published.

1 Like

thank you for the update.


You are welcome.

The issues you have found earlier (filed as CELLSNET-50380) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi


I updated the aspose package in my project and see that the issue has been resolved. Thank you.
However, if there is text before the anchor tag, the link is still not clickable.

Link to react”

Link to react text behind

Not working:

text in front

Link to react

text in front Link to react text in back


How could you do this in MS Excel manually? I tried to accomplish the task manually in MS Excel but to no avail. I add text into a cell and then try to add link to some selected words/chars but could not do that. Could you provide a sample file having your desired hyperlink in tact, we will check it soon.

I have textboxes in my app (1st screenshot) where a user can enter text and copy links inside of it. I am using Aspose Cells for C#, so when I am generating the excel report the html string is produced like it is in the 2nd screenshot.

image.png (1.4 KB)

Aspose example html string.png (4.9 KB)


Could you please share sample code (runnable) or a standalone console application (source code without compile time errors) and sample file(s) to reproduce the issue on our end. We will check your issue soon.

PS. please zip the files prior attaching here.

Please see attached console (6.0 MB)


I did test your scenario/case using your sample code. I do not think this is an issue. As I told you, for a cell’s data in MS Excel, you got to specify whole text as hyperlinked text so you cannot add hyperlink to selected/specific words/chars in the text. I tried to achieve your desired task in MS Excel manually using “Hyperlink” option/command but could not do that. Could you please provide a sample Excel file having your desired hyperlinks for selected words/chars in the text for Link3 and Link4. We will check on how to do it via Aspose.Cells APIs.

I understand what you’re saying, and I am not trying to add specific characters or words to a hyperlink.

My scenario is that my application has textboxes on the UI side. So if a user chooses to enter text in the textbox, and then copy and paste a link in the textbox, columns labeled Link3 and Link4 in the sample code will not work.

The forum does not authorize .xlsx extensions, so I have taken a screenshot of the excel file that is generated by the sample code.

I have changed the font color to orange for text that a user may type into a textbox, and changed the font color to green for the link that a user may copy and paste into the textbox.

Examples of how the html strings are generated are in the sample code.

Screenshot 2022-03-24 154848.png (16.7 KB)


Please zip the Excel file and attach it, we will check it further.

See attached. (8.5 KB)


Thanks for the file but we requested you to provide your expected file. I found the Link3 and Link4 cells are not hyperlinked at all (there is no link involved for the selected words/chars in the text), you just applied formatting (set colors and make some words/chars underlined) to those cells. So, kindly provide expected file having selected area/words hyperlinked only for Link3 and Link4. We will check on how to do it via Aspose.Cells APIs.

I cannot do this manually in Excel. If it not possible for links to work under these scenarios I just need confirmation that Aspose cannot generate links this way.


Aspose.Cells follows MS Excel standards and specifications. I am afraid, if something cannot be done in MS Excel manually, Aspose.Cells cannot do that too.

Okay. I appreciate your help thank you.