Skip to main content
Row

ISpreadsheetComponent.LoadDocument(String, DocumentFormat) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

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

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v26.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.Xlsx);
See Also