Is it possible to embed HTML values? I have an API returning HTML for formatting purposes (list, strong text, etc.), which needs to be exported into Excel. I previously exported the HTML using the following code:
var html = document.getElementById(id).outerHTML;
if (window.navigator.msSaveOrOpenBlob) {
var blobObject = new Blob([html]);
window.navigator.msSaveOrOpenBlob(blobObject, filename)
} else {
var link = $('<a id="download-xls"></a>');
$('body').append(link);
link.attr('href', 'data:application/vnd.ms-excel,' + encodeURIComponent(html));
link.attr('download', filename);
link[0].click();
}
This worked for the most part, except Excel understandably gave a security warning when opening the file.
Setting cell.v obviously does not work, and cell.h seems to only be used for reading. It seems like it may not be possible, but I want to make sure I haven't missed something.
Is it possible to embed HTML values? I have an API returning HTML for formatting purposes (list, strong text, etc.), which needs to be exported into Excel. I previously exported the HTML using the following code:
This worked for the most part, except Excel understandably gave a security warning when opening the file.
Setting cell.v obviously does not work, and cell.h seems to only be used for reading. It seems like it may not be possible, but I want to make sure I haven't missed something.