.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
A newer version of this page is available. Switch to the current version.

DocumentFormat Struct

A document format.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll


public struct DocumentFormat :


The DocumentFormat structure introduces fields to specify the file format with which a workbook can be saved or from which it can be loaded. Use the ISpreadsheetComponent.SaveDocument and ISpreadsheetComponent.LoadDocument methods to specify the document format.

The following example illustrates how to save a workbook in XLSX format.

Call the SpreadsheetControl.SaveDocument with the file path as a parameter to save a workbook to the file. Specify the file format as the second parameter of the method using the DocumentFormat enumerator.


Certain methods can throw unhandled exceptions if a problem occurs. Consider the situation when a document is being saved to a locked or read-only file. To prevent application failure, subscribe to the SpreadsheetControl.UnhandledException event and set the SpreadsheetUnhandledExceptionEventArgs.Handled property to true.

// Save the modified document to a file.
spreadsheetControl1.SaveDocument("Documents\\SavedDocument.xlsx", DocumentFormat.OpenXml);
See Also