Workbook clone

Posted by: pedro.moraes on 7 March 2025, 2:52 pm EST

  • Posted 7 March 2025, 2:52 pm EST

    Hello,

    I need to copy the workbook to make changes that don’t replicate in the original

    I did it like this

    const novoWorkbook = new GC.Spread.Sheets.Workbook();
        novoWorkbook.fromJSON(
          workbook.toJSON({
            ignoreStyle: excel.semEstilo,
            ignoreFormula: excel.semFormulas,
          })
        );

    But doing it this way takes a long time for large spreadsheets, is there another way?

  • Posted 10 March 2025, 8:05 am EST

    Hi,

    You are right that cloning a workbook using JSON may take time for large spreadsheets, but it is the best approach available to clone a SpreadJS instance. We are also discussing this case with the concerned team for a more better approach than JSON conversion (internal tracking id SJS-28524)

    In addition, could you please share the information about the file size that needs to be cloned in the SpreadJS?

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

    Best Regards,

    Ankit

  • Posted 19 March 2025, 12:03 am EST

    Hi,

    The developers have stated that there is no faster method for cloning than toJSON() and fromJSON(). Performance also depends on the file size and its contents.

    Best regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels