Posted 19 March 2023, 5:17 pm EST
With the SpreadJS V15/V16, you need to add one crucial line that enables compatibility with SpreadJS V15/V16:
global.self = global;
You may refer to the attached sample that is based on the steps outlined in the blog post located at https://www.grapecity.com/blogs/how-to-generate-excel-spreadsheets-in-nodejs
Please refer to the modified sample file attached herewith. To run the application successfully, start by installing the dependencies using the ‘npm install’ command. Afterward, on line number 14 and 15, add a valid license key. Finally, run the application with the ‘node index.js’ command. Upon successful execution, you should be able to see the name of the sheet and the value of Cell A1 being logged in the console.
Please note that the attached sample uses the SpreadJS V16(the latest version). You may change the SpreadJS Version in package.json file and set the License Key for V15 in the index.js file.
If you encounter any issues, please do not hesitate to reach out to us. We look forward to hearing about your experience with the updated sample.