Page tree

Versions Compared

Key

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

...

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

Dim WB As Workbook = XLAPP.Create(ExcelApplication.FileFormat.Excel2007Xlsx)

ExcelWriter has the ability to create Excel 2003 (XLS) files and Excel 2007 (XLSX) files, but cannot convert between formats. The file format must be declared when the workbook is created and the file extension of the output file must match when the file is saved.

...

Csharp
7
7

using SoftArtisans.OfficeWriter.ExcelWriter;
...
ExcelApplication XLAPP = new ExcelApplication();
Workbook WB = XLAPP.Create(ExcelApplication.FileFormat.Excel2007Xlsx);
Worksheet WKST = WB.Worksheets[0];
string value = DataValueBox.Text.Trim();
WKST.Cells[0,0].Value = value;
XLAPP.Save(WB, Page.Response, "Output.xlsx", false);

Vbnet
8
8

Include SoftArtisans.OfficeWriter.ExcelWriter
...
Dim XLAPP As New ExcelApplication()
Dim WB As Workbook = XLAPP.Create(ExcelApplication.FileFormat.Excel2007Xlsx)
Dim WKST As Worksheet = WB.Worksheets(0)
Dim value As String = DataValueBox.Text.Trim()
WKST.Cells(0, 0).Value = value
XLAPP.Save(WB, Page.Response, "Output.xlsx", False)

...