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

Glossary Item Box

OpenExcel2007File Method


See Also    DLL

Applies To

fpSpread control

Description

Imports the specified xlsx Excel-formatted file.

Syntax

C++

BOOL CSpreadSheet::OpenExcel2007File (LPCTSTR FileName, LPCTSTR Password, SHORT Sheet, SHORT ExcelSheet, LPCTSTR LogFileName);

Visual Basic

fpSpread.OpenExcel2007File(FileName As String, Password As String, Sheet As Integer, ExcelSheet As Integer, LogFileName As String) As Boolean

Parameters

The following parameters are available:

Parameter Description
FileName Path and name of the Excel-formatted file
Password Password of the Excel-formatted file (use null or empty string for no password)
Sheet Index of the sheet
ExcelSheet Index of the Excel sheet
LogFileName 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 -1 for the sheet index if you wish 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 method.

When you call the OpenExcel2007File method, you can specify whether to create a log file using the LogFileName parameter. When the OpenExcel2007File method 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 Type

True if successful; otherwise, False.

See Also

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

ExportToExcel, ImportExcelSheet, IsExcel2007File, SaveExcel2007File methods

DLL Correspondence

SSOpenExcel2007File function

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