# WorkbookEventArgs Class

> WorkbookEventArgs class in the TX Sheet Control .NET API: Detached workbook event context. Cancellation is honored by before-events, Loading and Saving.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Inherits:** `System.EventArgs`
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > WorkbookEventArgs Class
- **1796 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/llms-full.txt

---

Detached workbook event context. Cancellation is honored by before-events, Loading and Saving.

### Syntax

```csharp
public class WorkbookEventArgs
```

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [Address](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/address-property/llms-full.txt) | Single-cell address for interaction and editing events. |
| [Addresses](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/addresses-property/llms-full.txt) | Affected A1 cell addresses. |
| [AllowInvalid](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/allowinvalid-property/llms-full.txt) | Explicitly accepts a non-stop validation failure. Stop constraints remain enforced. |
| [ByteLength](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/bytelength-property/llms-full.txt) | Known input/output length in bytes. File contents and destination paths are never included. |
| [CanCancel](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/cancancel-property/llms-full.txt) | True only for events that can stop the proposed operation. |
| [Cancel](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/cancel-property/llms-full.txt) | Set synchronously in a cancellable event handler to roll back the attempted operation. |
| [Completed](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/completed-property/llms-full.txt) | Actual completed work in Unit. Counts restart when the phase changes. |
| [Data](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/data-property/llms-full.txt) | Detached event-specific values, including input, value or calculation pendingCount. |
| [ErrorCode](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/errorcode-property/llms-full.txt) | Diagnostic code on FileOperationFailed, when available. |
| [ErrorMessage](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/errormessage-property/llms-full.txt) | Diagnostic message on FileOperationFailed. The method still throws its original exception. |
| [IsCanceled](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/iscanceled-property/llms-full.txt) | True for a failed operation stopped by an event handler or cancellation request. |
| [Name](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/name-property/llms-full.txt) | The event name shared with the JavaScript typed event surface. |
| [Operation](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/operation-property/llms-full.txt) | File operation kind: load or save. Null for other workbook events. |
| [OperationId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/operationid-property/llms-full.txt) | Opaque correlation ID for one load/save operation, including concurrent calls. |
| [Phase](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/phase-property/llms-full.txt) | Processing stage: reading, parsing, snapshot, exporting, rendering, writing or completed. |
| [SheetId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/sheetid-property/llms-full.txt) | Worksheet identity independent of the active sheet. |
| [Source](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/source-property/llms-full.txt) | The originating operation, when available. |
| [Sources](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/sources-property/llms-full.txt) | Contributing operations inside one atomic batch. |
| [StreamType](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/streamtype-property/llms-full.txt) | File format involved in the operation. PDF is save-only. |
| [Total](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/total-property/llms-full.txt) | Known amount of work in Unit, or null for indeterminate stages. |
| [Unit](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/unit-property/llms-full.txt) | Progress counter unit: bytes or pages. Null when only a processing phase is known. |
| [Warnings](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/warnings-property/llms-full.txt) | Detached import notices on Loaded; empty for other events. |

### Examples

Subscribe while processing a document and return detached notifications for the application UI or audit trail. Handlers are synchronous: do not call document methods inside them. Only matching operations raise the selected event.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<string[]> CaptureReportNotificationsAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    var events = new List<string>();
    void OnNotification(object? sender, WorkbookEventArgs args)
    {
        events.Add(args.Name + ": " + string.Join(", ", args.Addresses));
    }

    book.Events.Changed += OnNotification;

    try
    {
        await sheet.Cell("A1").SetTextAsync("October invoice");
        await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
        await control.SaveAsync(StreamType.PDF);
    }
    finally
    {
        book.Events.Changed -= OnNotification;
    }

    return events.ToArray();
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Events and Cancellation](https://docs.textcontrol.com/tx-sheet-control/spreadsheet-editor/events/llms-full.txt)

---

## In This Section

- [WorkbookEventArgs.Address Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/address-property/llms-full.txt): WorkbookEventArgs.Address property in the TX Sheet Control .NET API: Single-cell address for interaction and editing events.
- [WorkbookEventArgs.Addresses Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/addresses-property/llms-full.txt): WorkbookEventArgs.Addresses property in the TX Sheet Control .NET API: Affected A1 cell addresses. Covers its type string[] and a C# example.
- [WorkbookEventArgs.AllowInvalid Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/allowinvalid-property/llms-full.txt): WorkbookEventArgs.AllowInvalid property in the TX Sheet Control .NET API: Explicitly accepts a non-stop validation failure. Stop constraints remain enforced.
- [WorkbookEventArgs.ByteLength Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/bytelength-property/llms-full.txt): WorkbookEventArgs.ByteLength property in the TX Sheet Control .NET API: Known input/output length in bytes. Covers its type long? and a C# example.
- [WorkbookEventArgs.CanCancel Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/cancancel-property/llms-full.txt): WorkbookEventArgs.CanCancel property in the TX Sheet Control .NET API: True only for events that can stop the proposed operation.
- [WorkbookEventArgs.Cancel Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/cancel-property/llms-full.txt): WorkbookEventArgs.Cancel property in the TX Sheet Control .NET API: Set synchronously in a cancellable event handler to roll back the attempted operation.
- [WorkbookEventArgs.Completed Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/completed-property/llms-full.txt): WorkbookEventArgs.Completed property in the TX Sheet Control .NET API: Actual completed work in Unit. Counts restart when the phase changes.
- [WorkbookEventArgs Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/constructor/llms-full.txt): WorkbookEventArgs constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [WorkbookEventArgs.Data Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/data-property/llms-full.txt): WorkbookEventArgs.Data property in the TX Sheet Control .NET API: Detached event-specific values, including input, value or calculation pendingCount.
- [WorkbookEventArgs.ErrorCode Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/errorcode-property/llms-full.txt): WorkbookEventArgs.ErrorCode property in the TX Sheet Control .NET API: Diagnostic code on FileOperationFailed, when available.
- [WorkbookEventArgs.ErrorMessage Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/errormessage-property/llms-full.txt): WorkbookEventArgs.ErrorMessage property in the TX Sheet Control .NET API: Diagnostic message on FileOperationFailed. Covers its type string? and a C# example.
- [WorkbookEventArgs.IsCanceled Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/iscanceled-property/llms-full.txt): WorkbookEventArgs.IsCanceled property in the TX Sheet Control .NET API: True for a failed operation stopped by an event handler or cancellation request.
- [WorkbookEventArgs.Name Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/name-property/llms-full.txt): WorkbookEventArgs.Name property in the TX Sheet Control .NET API: The event name shared with the JavaScript typed event surface.
- [WorkbookEventArgs.Operation Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/operation-property/llms-full.txt): WorkbookEventArgs.Operation property in the TX Sheet Control .NET API: File operation kind: load or save. Null for other workbook events.
- [WorkbookEventArgs.OperationId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/operationid-property/llms-full.txt): WorkbookEventArgs.OperationId property in the TX Sheet Control .NET API: Opaque correlation ID for one load/save operation, including concurrent calls.
- [WorkbookEventArgs.Phase Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/phase-property/llms-full.txt): WorkbookEventArgs.Phase property in the TX Sheet Control .NET API: Processing stage: reading, parsing, snapshot, exporting, rendering, writing or completed.
- [WorkbookEventArgs.SheetId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/sheetid-property/llms-full.txt): WorkbookEventArgs.SheetId property in the TX Sheet Control .NET API: Worksheet identity independent of the active sheet.
- [WorkbookEventArgs.Source Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/source-property/llms-full.txt): WorkbookEventArgs.Source property in the TX Sheet Control .NET API: The originating operation, when available. Covers its type string? and a C# example.
- [WorkbookEventArgs.Sources Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/sources-property/llms-full.txt): WorkbookEventArgs.Sources property in the TX Sheet Control .NET API: Contributing operations inside one atomic batch. Covers its type string[] and a C# example.
- [WorkbookEventArgs.StreamType Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/streamtype-property/llms-full.txt): WorkbookEventArgs.StreamType property in the TX Sheet Control .NET API: File format involved in the operation. PDF is save-only.
- [WorkbookEventArgs.Total Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/total-property/llms-full.txt): WorkbookEventArgs.Total property in the TX Sheet Control .NET API: Known amount of work in Unit, or null for indeterminate stages.
- [WorkbookEventArgs.Unit Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/unit-property/llms-full.txt): WorkbookEventArgs.Unit property in the TX Sheet Control .NET API: Progress counter unit: bytes or pages. Null when only a processing phase is known.
- [WorkbookEventArgs.Warnings Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/warnings-property/llms-full.txt): WorkbookEventArgs.Warnings property in the TX Sheet Control .NET API: Detached import notices on Loaded; empty for other events.

---

## Nearby

- **Previous:** [WorkbookCommand.Method Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookcommand/method-property/llms-full.txt)
- **Next:** [WorkbookEventArgs Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/workbookeventargs/constructor/llms-full.txt)
