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

Free Support Forum - aspose.com

From HTML string to workbook

I have to return a workbook from an html string. I convert the HTML string to a memory stream and then I pass it as a parameter to Workbook(stream, loadOptions).
The problem is that I keep getting this error and I don’t know what I should do: ‘‘utf-8 /><title’ is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name’.

My code is:
` Aspose.Cells.LoadOptions loadOptions = new Aspose.Cells.LoadOptions(Aspose.Cells.LoadFormat.Html);
System.IO.Stream stream = new System.IO.MemoryStream(ASCIIEncoding.Default.GetBytes(sourceHTML));

Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(stream, loadOptions);

    return wb;` 

The sourceHTML variable is attached to here: sourceHTML.docx (14.1 KB)

@JohnAxe754,
It seems that you are using some older version of the product as this issue is not reproduced with the latest version Aspose.Cells for .NET 21.10. Please give it a try with the latest version and share your feedback. If the issue is still there, share your complete runnable console application-based solution containing the template HTML file separately that can be used to test the issue. We will run the solution and share our feedback accordingly.

Also share your environment details with us.

Thanks, this was the solution. I was using an old version of Aspose.Cells.
The new one did the trick.

@JohnAxe754,

Good to know that your issue is sorted out by the new version/fix. Feel free to write us back if you have further queries or comments, we will be happy to assist you soon.