SSExportExcelBookEx Function
Applies To
fpSpread DLL control
Description
Exports the control's contents to an Excel-formatted file.
Syntax
BOOL SSExportExcelBookEx(HWND hWnd, LPCTSTR lpszFileName, LPCTSTR lpszLogFileName, SHORT Flags);
BOOL TSpread::ExportExcelBookEx(LPCTSTR lpszFileName, LPCTSTR lpszLogFileName, SHORT Flags);
Parameters
The following parameters are available:
Parameter | Description |
---|---|
hWnd | Window handle of the fpSpread control |
lpszFileName | Path and file name of Excel-formatted file to create |
lpszLogFileName | Path and file name of log file to create If you do not provide a file name, the export will not create a log file. If you do not want to create a log file, set this parameter to NULL. |
Flags | Whether to save formulas to the file |
Constants | Value | Description |
---|---|---|
SS_EXCELSAVEFLAG_NONE | 0 | No flags |
SS_EXCELSAVEFLAG_NOFORMULAS | 1 | No formulas |
Remarks
Use this function to export the contents of the Spread control to an Excel-formatted file, which contains the sheets as a workbook. The file to which you export will be in the BIFF8 format, which is the format used by Excel 97, Excel 2000, and Excel 2002. Avoid using characters in the sheet name that Excel considers invalid such as ? / \ * [ ].
When you export, you can choose to have Spread create a log file that details how certain data and cell characteristics are handled during the export. To have Spread create an export log file, specify the path and file name in the lpszLogFileName parameter. If you do not specify a path, Spread will place the log file in the current drive and directory. Use the Flags parameter to specify whether to export formulas.
By default, Excel-formatted files created using Spread or the Spread Designer have the extension .XLS. However, you can use any extension.
If you want to import an existing Excel-formatted file, call the SSImportExcelBook function or the SSGetExcelSheetList, SSImportExcelSheet, and SSIsExcelFile functions.
Return Value
TRUE if the function completes successfully; FALSE otherwise.
See Also
Exporting to an Excel-Formatted File
Excel-Formatted File Import/Export (online PDF manual)
SSGetExcelSheetList, SSImportExcelBook, SSImportExcelSheet, SSIsExcelFile functions
ActiveX Correspondence
ExportToExcelEx method