SSImportExcelBook Function
Applies To
fpSpread DLL control
Description
Imports the specified Excel-formatted file.
Syntax
BOOL SSImportExcelBook(HWND hWnd, LPCTSTR lpszFileName, LPCTSTR lpszLogFileName);
BOOL TSpread::ImportExcelBook(LPCTSTR lpszFileName, 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 |
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 workbook from an Excel-formatted file. Spread can only import from Excel-formatted files in BIFF8 format, which is the format used by Excel 97, Excel 2000, and Excel 2002.
When you call the SSImportExcelBook function, you can specify to create a log file using the lpszLogFileName parameter. When the SSImportExcelBook 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, SSIsExcelFile, SSSaveExcel2007File functions
ActiveX Correspondence
ImportExcelBook method