Spread WPF Documentation
Importing and Exporting Excel Files

You can save or load Excel-formatted files and specify various save or load options.

You can specify whether to save to a BIFF or OfficeXML formatted file. BIFF (Binary Interchange File Format) is well known as the default file format for Microsoft Office Excel 97-2003, and the default file extension is .XLS. Office Open XML is well known as the default file format for Microsoft Office Excel 2007, and the default file extension is .XLSX. You can use the ExcelSaveFlags enumeration in the SaveExcel method to specify additional options such as custom row and column headers or data only. You can also specify a password when exporting to a file.

You can specify additional load options with the ExcelOpenFlags enumeration in the OpenExcel method. You can also specify a password string when loading an Excel-formatted file.

You can use the ExcelError event and the ExcelWarning class to return error codes and get unsupported records.

Charts are not imported and formulas in tables may not be imported correctly when loading Excel-formatted files.

Using Code

The following example uses the SaveExcel and OpenExcel methods to save and load files.

CS
Copy Code

gcSpreadSheet1.SaveExcel("c:\\zipfile\\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders);

//gcSpreadSheet1.OpenExcel("c:\\zipfile\\test.xlsx");

VB.NET
Copy Code

GcSpreadSheet1.SaveExcel("c:\zipfile\test.xlsx", GrapeCity.Windows.SpreadSheet.Data.ExcelFileFormat.XLSX, GrapeCity.Windows.SpreadSheet.Data.ExcelSaveFlags.SaveBothCustomRowAndColumnHeaders)

'GcSpreadSheet1.OpenExcel("c:\zipfile\test.xlsx")

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options | Documentation Feedback