Spread 8.0 Documentation
SSExportToExcel Function
Support Options
DLL Reference > DLL Functions > SSExportToExcel Function

Glossary Item Box

SSExportToExcel Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Exports the sheet to a sheet in an Excel-formatted file.

Syntax

C

BOOL SSExportToExcel(HWND hWnd, LPCTSTR lpszFileName, LPCTSTR lpszSheetName, LPCTSTR lpszLogFileName);

C++

BOOL TSpread::ExportToExcel(LPCTSTR lpszFileName, LPCTSTR lpszSheetName, 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
lpszSheetName Name of the sheet to create in the file
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

This function is applied to the current sheet setting unless you first call the SSSetSheet function to specify the sheet for which you are calling this function.

Use this function to export the sheet to a sheet in an Excel-formatted file. 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 the sheet, 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 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 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, SSImportExcelSheet, SSIsExcelFile, SSSetSheet functions

ActiveX Correspondence

ExportToExcel method

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.