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:
Create an instance of ExcelApplication:
Open an Excel workbook from a file path or a System.IO.Stream:
Return a Worksheet object:
Modify the worksheet. For example, add a cell value:
Save the modified file with a new name, or stream it to the client:
For more information on save options, see Output Options.