Spread 8.0 Documentation
ExportExcelBook Method
Support Options
ActiveX Reference > ActiveX Methods > ExportExcelBook Method

Glossary Item Box

ExportExcelBook Method


See Also    DLL    Example

Applies To

fpSpread control

Description

Exports the workbook to the specified Excel-formatted file.

Syntax

C++

BOOL CSpreadSheet::ExportExcelBook(LPCTSTR FileName, LPCTSTR LogFileName);

Visual Basic

fpSpread.ExportExcelBook(ByVal FileName As String, ByVal LogFileName As String) As Boolean

Parameters

The following parameters are available:

Parameter Description
FileName Path and file name of Excel-formatted file to create
LogFileName 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 "".

Remarks

Use this method 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 LogFileName 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 may use any extension.

Tip: You might want to save to 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 Method
Binary file (proprietary format) SaveToFile
Tab-delimited file SaveTabFile or SaveTabFileU
Delimited file (offers user-defined delimiters) ExportToTextFile or ExportRangeToTextFile
or ExportToTextFileU or ExportRangeToTextFileU
Excel-formatted file ExportExcelBook or ExportToExcel
HTML file ExportToHTML or ExportRangeToHTML
XML file ExportToXML or ExportRangeToXML
XML buffer ExportToXMLBuffer or ExportRangeToXMLBuffer
An array GetArray

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, use the ImportExcelBook method or the GetExcelSheetList, ImportExcelSheet, and IsExcelFile methods.

Return Type

True if successful; otherwise, False.

See Also

Exporting to an Excel-Formatted File
Excel-Formatted File Import/Export (online PDF manual)

ExportToExcel, GetExcelSheetList, ImportExcelBook, ImportExcelSheet, IsExcelFile methods

DLL Correspondence

SSExportExcelBook function

Copyright © GrapeCity, inc. All rights reserved.