Getting a "File is Corrupt" error from Excel when ...
# suitescript
n
Getting a "File is Corrupt" error from Excel when I open the XLS file that I'm creating. Can anyone see the issue with this code?
This is the XML that gets encoded :
Copy code
<?xml version="1.0"?><?mso-application progid="Excel.sheet"?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="<http://www.w3.org/TR/REC-html40>"> <Worksheet Name="FirstTab"> <Table><Row><Cell>12</Cell></Row> </Table> </Worksheet></Workbook>
a
I don't think .xls format is just base64 encoded xml maybe this will help? https://stackoverflow.com/questions/39921856/conversion-of-base64-encoded-into-xslx
n
I was using this SA Article Create Excel File via SuiteScript 2.0 so I was thinking it would work with that code.
a
umm okay, you're missing the
ss:
references xml
that's the only difference i'm seeing
1
umm I guess you also don't have the Data tag wrapper
1
c
Just use sheets.js instead
☝️ 1
n
@Anthony OConnor you are onto it. ss: on the Data wrapper. thank you
👍 1