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

Glossary Item Box

SSOpenExcel2007File Function


See Also    ActiveX

Applies To

fpSpread DLL control

Description

Imports the specified xlsx Excel-formatted file.

Syntax

C

BOOL SSOpenExcel2007File(HWND hWnd, LPCTSTR lpszFileName, LPCTSTR lpszPassword, short nSheet, short nExcelSheet, LPCTSTR lpszLogFileName);

C++

BOOL TSpread::OpenExcel2007File(LPCTSTR lpszFileName, LPCTSTR lpszPassword, short nSheet, short nExcelSheet, LPCTSTR lpszLogFileName);

Parameters

The following parameters are available:

Parameter Description
hWnd Window handle of the fpSpread control
lpszFileName Path and name of the Excel-formatted file
lpszPassword Password for the file (use null or empty string for no password)
nSheet Index number of the Spread sheet
nExcelSheet Index number of the Excel sheet
lpszLogFileName Specifies the path and file name of the log file created when Spread imports the workbook
If you do not provide a file name, the import will not create a log file. If you do not want to create a log file, set to "".

Remarks

Use this function to import a sheet or workbook from an xlsx Excel-formatted file. Use -1 for nSheet if you want to open the entire workbook. If you specify a sheet index other than -1, then you must specify both the Spread and Excel sheet indexes. See the readme for special redistribution requirements for this function.

When you call the SSOpenExcel2007File function, you can specify to create a log file using the lpszLogFileName parameter. When the SSOpenExcel2007File function is called, the conversion process creates a log file with information about the conversion of the Excel-formatted file.

Caution: Loading an Excel file into the control deletes the data currently in the control. The loaded file overwrites existing data. Also, if your sheet had more columns and rows than the loaded sheet, those columns and rows are removed. For example, if your sheet had 100 columns and rows of data, and the loaded sheet has 50 columns and rows of data, once the new sheet is loaded, the control only has 50 columns and rows.

For instructions and more information about importing Excel-formatted files, see Loading 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.

Return Value

TRUE if the function completes successfully; FALSE otherwise.

See Also

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

SSExportExcelBook, SSExportToExcel, SSGetExcelSheetList, SSIsExcel2007File, SSSaveExcel2007File functions

ActiveX Correspondence

OpenExcel2007File method

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