Import excel: Getting `import` function undefined

Posted by: nmudaliar on 28 May 2025, 9:01 am EST

    • Post Options:
    • Link

    Posted 28 May 2025, 9:01 am EST - Updated 28 May 2025, 9:32 am EST

    Hey,

    I’m new to spreadJS, I’m using spreadJS in the angular application.

    1. I’m trying to import xlsx file.
    this.spread.import(file, function() {}, function() {}, options);

    But I’m getting

    import
    undefined.

    1. Then I tried to start 30 day free trial. I’m not sure how to integrate the downloaded zip file.
  • Posted 29 May 2025, 1:36 am EST

    Hi,

    The import function of SpreadJS is available with the @mescius/spread-sheets-io : https://www.jsdelivr.com/package/npm/@mescius/spread-sheets-io plugin. Therefore, it is required to import this script into the application and the import function will run as expected.

    You can also refer to the SpreadJS Import & Export Demo : https://developer.mescius.com/spreadjs/demos/features/spreadjs-file-format/overview/purejs which illustrates the use of the import function in SpreadJS.

    Please feel free to reach out if you encounter any further issues or require additional guidance.

    Best Regards,

  • Posted 29 May 2025, 2:49 am EST - Updated 29 May 2025, 2:58 am EST

    Hi Priyam,

    Thank you for your response.

    I installed this npm package: https://www.jsdelivr.com/package/npm/@mescius/spread-sheets-io

    But still getting

    import
    function undefined.

    JFYI, I’m using angular application. Could you please help me out what am I missing here?

    UPD: I forgot to import

    import '@mescius/spread-sheets-io'
    Now it works!

    Thank you

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels