Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Vbnet
2
2

Dim XLAPP As New ExcelApplication()

Unlike the ExcelTemplate object, which represents a single file, the ExcelApplication works as a file generation engine. The ExcelApplication object can be used to create, open, and save multiple workbooks.

3. Create a new workbook with ExcelApplication.Create()

Csharp
3
3
Workbook WB = XLAPP.Create(ExcelApplication.FileFormat.Excel2007);

...

Vbnet
6
6

XLAPP.Save(WB, Page.Response, "Output.xlsx", False)

ExcelApplication.Save has the same output options as ExcelTemplate: save to disk, save to memory stream, stream back to the client inline, and stream back to the client as an attachment. In this case, we're streaming the workbook back to the client as an attachment.
Remember that the file extension must match the file format specified when the workbook was created.

...