.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

WorkbookImportOptions.ThrowExceptionOnInvalidDocument Property

Specifies whether an exception should be thrown when importing an invalid document.

Namespace: DevExpress.XtraSpreadsheet.Import

Assembly: DevExpress.Spreadsheet.v21.2.Core.dll


public bool ThrowExceptionOnInvalidDocument { get; set; }

Property Value

Type Description

true, if an exception is thrown when importing an invalid document; otherwise, false.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to ThrowExceptionOnInvalidDocument
WinForms Controls SpreadsheetControlOptions
Office File API DocumentOptions


Every time you try to load an invalid document into the SpreadsheetControl or Workbook, the SpreadsheetControl.InvalidFormatException or Workbook.InvalidFormatException event fires. You can subscribe to this event and perform the actions required to resolve this situation (for example, inform an end-user about the incorrect file). If the ThrowExceptionOnInvalidDocument property is set to true, an exception is thrown after the InvalidFormatException event has occurred.

See Also