Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.8.1
ASP/COM Platform

View Docs for Another
Version or Platform

ExcelApplication in Depth > Output Options

ExcelApplication is not
available in ExcelWriterSE.

Output Options

After creating a workbook with ExcelApplication, you can:

  • Save it to disk

  • Return it as a sequence of bytes in memory.

  • Stream it to the client and open it in Excel.

  • Stream it to the client and open it in the browser. In this case, Internet Explorer's menus and toolbars will be replaced with Excel's.

  • Return it as an ExcelTemplate object.

ExcelApplication's Save method takes three optional parameters:

[varBytes =] objExcelApplication.Save [FileName], [SaveMethod], [SaveFormat]
ExcelApplication.Save Parameters

FileName Optional. If saving to disk, assign the path and file name of the new spreadsheet. If opening the file, assign a file name only. To return the file in memory, do not assign a value to this parameter.
SaveMethod
Default value: 0

Optional. Specifies whether to save the file to disk, open it in Excel, open it in the browser, return it in memory, or return it as an ExcelTemplate object.

0saDefaultIf a FileName is assigned, the file will be saved to disk.

If a FileName is not assigned, the file will be returned in memory as a sequence of bytes.
1saOpenInExcelOpen the file in Excel
2saOpenInPlaceOpen in the browser
3saOpenAsTemplateReturn an ExcelTemplate object.
SaveFormat
Default value: 8

Optional. Specifies whether to save the spreadsheet in BIFF7 (Excel 95) or BIFF8 (Excel 97/2000) format.

8saFileFormatDefault
7saFileFormatExcel95

To use ExcelWriter constants (e.g., saFileFormatExcel95), include ExcelWriter's TypeLib metadata tag at the beginning of your script:
<!--METADATA TYPE="TypeLib" UUID="{7BCD2133-64A0-4770-843C-090637114583}"-->

ExcelApplication.Save Examples

Example Result
varBytes = xlw.Save
Return the spreadsheet as a sequence of bytes to varBytes.
xlw.Save "d:\reports\report1.xls",,_
		saFileFormatExcel95
Save the file in Excel95 (BIFF7) format to a specific location on the hard disk.
xlw.Save "report.xls", saOpenInExcel
Open in Excel on the client. If the user saves the file, it will have report.xls as the default name. If the file has already been cached by the browser, it will appear as report(1).xls.
xlw.Save "report.xls", saOpenInPlace
Open in the browser window. If the user doesn't have MS-Excel support in IE, it will ask the user to save the file.
In this case, the Filename property isn't used, instead the browser will use the webserver script(which generates this Excel file) name as the default name.



Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.