[]
Fired while data is being read from or written into a workbook.
public event XLProgressEventHandler Progress
Type | Description |
---|---|
XLProgressEventHandler | Fired while data is being read from or written into a workbook. |
This event is typically used to update the application UI during lengthy operations. It can also be used to cancel the operations.
The code below writes messages to the output window while the application Excel files.
void Load()
{
// create workbook
C1XLBook book = new C1XLBook();
// progress event handler
book.Progress += new XLProgressEventHandler(load_Progress);
// load workbook
book.Load(xlFileName);
}
// print messages while workbook are loaded
void load_Progress(object sender, XLProgressEventArgs e)
{
Console.WriteLine("Loading {0}, {1:p0} done",
e.FileName, e.Position/(float)e.FileLength);
}