Back to Devexpress

WorkbookImportOptions.ThrowExceptionOnInvalidDocument Property

officefileapi-devexpress-dot-xtraspreadsheet-dot-import-dot-workbookimportoptions-e5f15d27.md

latest2.5 KB
Original Source

WorkbookImportOptions.ThrowExceptionOnInvalidDocument Property

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

Namespace : DevExpress.XtraSpreadsheet.Import

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public bool ThrowExceptionOnInvalidDocument { get; set; }
vb
Public Property ThrowExceptionOnInvalidDocument As Boolean

Property Value

TypeDescription
Boolean

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

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ThrowExceptionOnInvalidDocument
DocumentOptions

.Import .ThrowExceptionOnInvalidDocument

|

Remarks

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

InvalidFormatException

WorkbookImportOptions Class

WorkbookImportOptions Members

DevExpress.XtraSpreadsheet.Import Namespace