SSExportExcelBook Function
Applies To
fpSpread DLL control
Description
Exports the control's contents to an Excel-formatted file.
Syntax
BOOL SSExportExcelBook(HWND hWnd, LPCTSTR lpszFileName, LPCTSTR lpszLogFileName);
BOOL TSpread::ExportExcelBook(LPCTSTR lpszFileName, LPCTSTR lpszLogFileName);
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. |
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.
By default, Excel-formatted files created using Spread or the Spread Designer have the extension .XLS. However, you can use any extension.
Tip: You might want to save your sheet as a Spread (.SS8) file in addition to exporting it to Excel so that you can open the Spread (.SS8) file for future modifications. |
The following table summarizes the formats to which you can save data:
To Save To . . . | Use Function |
---|---|
Binary file (proprietary format) | SSSaveToFile |
Tab-delimited file | SSSaveTabFile or SSSaveTabFileU |
Delimited file (offers user-defined delimiters) | SSExportToTextFile or SSExportRangeToTextFile or SSExportToTextFileU or SSExportRangeToTextFileU |
Excel-formatted file | SSExportExcelBook, SSExportExcelBookEx, SSExportToExcelEx, or SSExportToExcel |
HTML file | SSExportToHTML or SSExportRangeToHTML |
XML file | SSExportToXML or SSExportRangeToXML |
XML buffer | SSExportToXMLBuffer or SSExportRangeToXMLBuffer |
An array | SSGetArray |
For instructions and more information about exporting Excel-formatted files, see Exporting to an Excel-Formatted File and Excel-Formatted File Import/Export (online PDF manual). Excel-Formatted File Import/Export includes a list and description of the log message numbers.
If you want to import an existing Excel-formatted file, call the SSImportExcelBook method or the SSGetExcelSheetList, SSImportExcelSheet, and SSIsExcelFile methods.
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
ExportToExcel method