C1.WPF.Grid.Excel Assembly / C1.WPF.Grid Namespace / Extensions Class / LoadExcelAsync Method / LoadExcelAsync(FlexGrid,String,ExcelFileFormat,String,LoadExcelOptions,CancellationToken) Method
Instance of the FlexGrid to load the data into.
The path to the Excel file.
A ExcelFileFormat file format.
The name of the Excel sheet to load. If null, the first sheet will be loaded by default.
A LoadExcelOptions loading options.
The token to monitor for cancellation requests.

LoadExcelAsync(FlexGrid,String,ExcelFileFormat,String,LoadExcelOptions,CancellationToken) Method
Loads data from an Excel file into the specified grid asynchronously.
Syntax
'Declaration
 
Public Overloads Shared Function LoadExcelAsync( _
   ByVal grid As FlexGrid, _
   ByVal fileName As String, _
   ByVal fileFormat As ExcelFileFormat, _
   ByVal sheetName As String, _
   ByVal options As LoadExcelOptions, _
   ByVal cancellationToken As CancellationToken _
) As Task
 

Parameters

grid
Instance of the FlexGrid to load the data into.
fileName
The path to the Excel file.
fileFormat
A ExcelFileFormat file format.
sheetName
The name of the Excel sheet to load. If null, the first sheet will be loaded by default.
options
A LoadExcelOptions loading options.
cancellationToken
The token to monitor for cancellation requests.

Return Value

A System.Threading.Tasks.Task representing the asynchronous operation.
Exceptions
ExceptionDescription
The exception that is thrown when one of the arguments provided to a method is not valid.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.
The exception that is thrown when a path or fully qualified file name is longer than the system-defined maximum length.
The exception that is thrown when part of a file or directory cannot be found.
The exception that is thrown when the operating system denies access because of an I/O error or a specific type of security error.
The exception that is thrown when an attempt to access a file that does not exist on disk fails.
The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality.
The exception that is thrown when an I/O error occurs.
The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method.
The exception that is thrown in a thread upon cancellation of an operation that the thread was executing.
See Also