Skip to end of metadata
Go to start of metadata
ExcelApplication can open and modify an existing spreadsheet. The new spreadsheet can either be saved to disk (overwriting the original file or saved with a new name) or streamed to the browser. This allows you to use a preset format for similar spreadsheets, rather than recreate the format for each.

Alternatively, use an ExcelWriter template.

All features in the original workbook - including macros, charts, PivotTables, and VBA - will be preserved in the new workbook.

How to Modify an Existing Spreadsheet

To modify an existing spreadsheet:

  1. Create an instance of ExcelApplication:

  2. Open an Excel workbook from a file path or a System.IO.Stream:

    Or:

  3. Return a Worksheet object:

  4. Modify the worksheet. For example, add a cell value:

  5. Save the modified file with a new name, or stream it to the client:

    Or:

    For more information on save options, see Output Options.

  • No labels