Message-ID: <1915878238.2157.1710819563203.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2156_1990947735.1710819563203" ------=_Part_2156_1990947735.1710819563203 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Alternatively, use an ExcelWriter tem= plate.
All features in the original workbook - including macros, charts, PivotT= ables, and VBA - will be preserved in the new workbook.
To modify an existing spreadsheet:
Create an instance of ExcelApplication:
ExcelApplication xla =3D new ExcelApplication();=20
Open an Excel workbook from a file path or a System.IO.Stream:
//--- Open a workbook from a file path: Workbook wb =3D xla.Open(@"C:\Reports\Report.xlsx");=20
Or:
//--- Open a workbook from a Stream: FileStream fs =3D new FileStream(@"C:\Sales\2003\June.xlsx", File= Mode.Open); Workbook wb =3D xla.Open(fs);=20
Return a Worksheet object:
Worksheet ws =3D wb.Worksheet[0];=20
Modify the worksheet. For example, add a cell value:
ws.Cells[0, 0].Value =3D "Welcome to SoftArtisans OfficeWri= ter";=20
Save the modified file with a new name, or stream it to the client:<= /p>
//--- Save the file on the server: xla.Save(wb, @"C:\temp\out.xlsx");=20
Or:
//--- Stream the file to the client via HTTP: //--- false means Open In Excel, true means Open In Browser (IE only) xla.Save(wb, Page.Response, "out.xlsx", false);=20
For more information on save options, see Output Options.