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

Glossary Item Box

SSSaveExcel2007File Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Exports the control's contents to an xlsx Excel-formatted file.

Syntax

C

BOOL SSSaveExcel2007File(HWND hWnd, LPCTSTR lpszFileName, LPCTSTR lpszPassword, short nFlags , LPCTSTR lpszLogFileName);

C++

BOOL TSpread::SaveExcel2007File(LPCTSTR lpszFileName, LPCTSTR lpszPassword, short nFlags, 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
lpszPassword Password for the file (use null or empty string for no password)
nFlags Additional export options
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.

Constants Value Description
SS_SAVEEXCELFILEFLAG_NONE 0 No flags
SS_SAVEEXCELFILEFLAG_NOFORMULAS 1 No formulas
SS_SAVEEXCELFILEFLAG_DATAONLY 32 Export data only

Remarks

Use this function to export the contents of the Spread control to an xlsx Excel-formatted file. 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 the Spread Designer have the extension .XLSX. However, you can use any extension. See the readme for special redistribution requirements for this function.

If you want to import an existing Excel-formatted file, call the SSImportExcelBook or SSOpenExcel2007File function.

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, SSIsExcel2007File functions

ActiveX Correspondence

SaveExcel2007File method

Copyright © GrapeCity, inc. All rights reserved.