So, I’m trying to convert a HTML file to a excel sheet but I’m finding that one of the cells with specific information in doesn’t seem to get the correct (or expected) field data when loading as a worksheet using the cells api.
In HTML, one of the field was hyperlink when i try to convert into excel extra space will be the part of that hyperlink.
How it look like in html : HTTPS://Google.com
when it convert into excel : HTTPS://Google.com___
Code
Dim tempHtmlFileName As String = “C:\Users\hardik\AppData\Local\Temp\Test.xlsx.html”
Dim license As Aspose.Cells.License = New Aspose.Cells.License()
license.SetLicense(“Aspose.Cells.lic”)
Dim LoadOptions As Aspose.Cells.HTMLLoadOptions = New Aspose.Cells.HTMLLoadOptions(Aspose.Cells.LoadFormat.Html)
Dim wb As Aspose.Cells.Workbook = New Aspose.Cells.Workbook(tempHtmlFileName, LoadOptions)
wb.Worksheets(0).AutoFitRows()
wb.Worksheets(0).AutoFitColumns()
wb.Save(“Test.xlxs”)
Attachment file was in png but original file was in html. HTML format not supported
image.png (2.6 KB)
Team Please help me to resolve the issue. Thanks in advance
Aspose dll version 18.12
@hardik011,
Thanks for the screenshot.
I tested your scenario/case using latest version/fix: Aspose.Cells for .NET v24.5 and it works fine. I used a sample (input) HTML file (attached). I simply created it as per your screenshot in MS Excel manually and save it as HTML (“Web Page”). The converted output XLSX file (attached) is fine tuned.
e.g.,
Sample code:
[C#]
string tempHtmlFileName = "e:\\test2\\Bk_hyperlinks1.html";
HtmlLoadOptions LoadOptions = new HtmlLoadOptions(Aspose.Cells.LoadFormat.Html);
Workbook wb = new Aspose.Cells.Workbook(tempHtmlFileName, LoadOptions);
wb.Worksheets[0].AutoFitRows();
wb.Worksheets[0].AutoFitColumns();
wb.Save("e:\\test2\\out1.xlsx");
Bk_hyperlinks1.zip (1.3 KB)
out1.zip (6.6 KB)
Please check and test with the attached files using latest version and let us know your feedback. If you still find the issue, kindly do provide your input HTML file (please zip it prior attaching), we will check it soon.
@amjad.sahi ,
Thanks for the response.
I have tried with your solution and same code which you shared with me. not working for me . I have created new solution and tried with latest aspose.cell dll. I will share my excel file can you please check and let me know. thanks.
test.xlsx.zip (1.5 KB)
@hardik011,
Thanks for the sample HTML file.
After an initial test, I am able to reproduce the issue as you mentioned by using the following sample code and template Excel file (attached). I found the issue with hyperlinks in cells which are not working upon clicking on them in the output Excel file. I used the original code which I shared earlier.
We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-55804
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@hardik011 ,
We are pleased to inform you that your issue has been resolved. The fix will be included in an upcoming release (Aspose.Cells v24.6) that we plan to release in the first half of June 2024. You will be notified when the next version is released.
Attached is the result after fix for your reference:
output.zip (7.2 KB)
@Eric.wang ,
Once latest dll released i will check and update you.
Thanks
@hardik011,
Sure, we will keep you posted with updates (once available) on it.
@amjad.sahi Latest version uploaded ?
@hardik011
We will release the new version 24.6 in this week.
If it’s released , we will inform you here.
The issues you have found earlier (filed as CELLSNET-55804) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi