Skip to main content
Row

ISpreadsheetComponent.LoadDocument(String, DocumentFormat) Method

Loads a document from a file, specifying the document format.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

bool LoadDocument(
    string fileName,
    DocumentFormat format
)

Parameters

Name Type Description
fileName String

A string specifying the file to load (including the full path).

format DocumentFormat

One of the DocumentFormat members.

Returns

Type Description
Boolean

true, if a document is loaded successfully; otherwise, false.

Example

Call the SpreadsheetControl.LoadDocument method with the file path to load a workbook from the existing file. Specify the file format as the second parameter of the method using the DocumentFormat enumerator.

View Example

// Load a workbook from a file.
spreadsheetControl1.LoadDocument("Documents\\Document.xlsx", DocumentFormat.OpenXml);

The following code snippets (auto-collected from DevExpress Examples) contain references to the LoadDocument(String, DocumentFormat) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also