Back to Devexpress

Workbook.Dispose() Method

officefileapi-devexpress-dot-spreadsheet-dot-workbook-eda38b42.md

latest3.3 KB
Original Source

Workbook.Dispose() Method

Releases resources associated with a Workbook instance.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this method in production code.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public void Dispose()
vb
Public Sub Dispose

Remarks

When you finish working with a Workbook instance, call the Dispose method to release all the resources used by the object. This action helps you avoid memory leaks and speed up system performance. You can also modify your Workbook within the using statement ( Using block in Visual Basic).

csharp
// Add a reference to the DevExpress.Docs.dll assembly.
using DevExpress.Spreadsheet;
// ...

// Create a Workbook instance.
Workbook workbook = new Workbook();

// Modify the workbook.
// ...

// Dispose the workbook.
workbook.Dispose();
vb
' Add a reference to the DevExpress.Docs.dll assembly.
Imports DevExpress.Spreadsheet
' ...

' Create a Workbook instance.
Private workbook As New Workbook()

' Modify the workbook.
' ...

' Dispose the workbook.
workbook.Dispose()

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Dispose() 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.

spreadsheet-document-api-import-data-from-data-sources/CS/DataImportExample/Form1.cs#L36

csharp
}
    workbook.Dispose();
}

spreadsheet-document-api-import-data-from-data-sources/VB/DataImportExample/Form1.vb#L28

vb
End Try
    workbook.Dispose()
End Sub

Implements

Dispose()

See Also

Workbook Class

Workbook Members

DevExpress.Spreadsheet Namespace