Class
XlsmFormatProvider

Imports and exports workbooks in Excel Macro-Enabled Workbook (.xlsm) format, preserving VBA macros and scripts.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsm

Assembly:Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.dll

Syntax:

cs-api-definition
public class XlsmFormatProvider : BinaryWorkbookFormatProviderBase, IBinaryWorkbookFormatProvider, IWorkbookFormatProvider

Inheritance: objectWorkbookFormatProviderBaseBinaryWorkbookFormatProviderBaseXlsmFormatProvider

Implements: IBinaryWorkbookFormatProviderIWorkbookFormatProvider

Inherited Members BinaryWorkbookFormatProviderBase.Import(byte[])BinaryWorkbookFormatProviderBase.Import(byte[], TimeSpan?)BinaryWorkbookFormatProviderBase.Export(Workbook)BinaryWorkbookFormatProviderBase.Export(Workbook, TimeSpan?)WorkbookFormatProviderBase.Import(Stream)WorkbookFormatProviderBase.Import(Stream, TimeSpan?)WorkbookFormatProviderBase.Export(Workbook, Stream)WorkbookFormatProviderBase.Export(Workbook, Stream, TimeSpan?)

Constructors

XlsmFormatProvider()

Initializes a new instance of the XlsmFormatProvider class.

Declaration

cs-api-definition
public XlsmFormatProvider()

Properties

CanExport

Indicates whether this provider supports exporting workbooks to .xlsm format.

Declaration

cs-api-definition
public override bool CanExport { get; }

Property Value

bool

The value indicating whether can export.

Overrides WorkbookFormatProviderBase.CanExport

CanImport

Indicates whether this provider supports importing .xlsm files into workbook instances.

Declaration

cs-api-definition
public override bool CanImport { get; }

Property Value

bool

The value indicating whether can import.

Overrides WorkbookFormatProviderBase.CanImport

FilesDescription

Human-readable description of supported files (e.g., "Excel Macro-Enabled Workbook").

Declaration

cs-api-definition
public override string FilesDescription { get; }

Property Value

string

The files description.

Overrides WorkbookFormatProviderBase.FilesDescription

Name

Identifier for this format provider, used for discovery and registration.

Declaration

cs-api-definition
public override string Name { get; }

Property Value

string

The name of the provider.

Overrides WorkbookFormatProviderBase.Name

SupportedExtensions

File extensions recognized by this provider (e.g., ".xlsm").

Declaration

cs-api-definition
public override IEnumerable<string> SupportedExtensions { get; }

Property Value

IEnumerable<string>

The supported extensions.

Overrides WorkbookFormatProviderBase.SupportedExtensions

Methods

ExportOverride(Workbook, Stream)

Writes the workbook to the stream in .xlsm format, preserving any VBA macros or scripts present.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken) instead.")]
protected override void ExportOverride(Workbook workbook, Stream output)

Parameters

workbook

Workbook

The workbook.

output

Stream

The output.

Overrides WorkbookFormatProviderBase.ExportOverride(Workbook, Stream)

ExportOverride(Workbook, Stream, CancellationToken)

Writes the workbook to the stream in .xlsm format with cancellation support, preserving any VBA macros or scripts present.

Declaration

cs-api-definition
protected override void ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken)

Parameters

workbook

Workbook

The workbook.

output

Stream

The output.

cancellationToken

CancellationToken

The cancellation token used to cancel the operation.

Overrides WorkbookFormatProviderBase.ExportOverride(Workbook, Stream, CancellationToken)

ImportOverride(Stream)

Reads an .xlsm file from the stream and constructs a Workbook instance, preserving VBA macros if present.

Declaration

cs-api-definition
[Obsolete("This method is obsolete. Please use ImportOverride(Stream input, CancellationToken cancellationToken) instead.")]
protected override Workbook ImportOverride(Stream input)

Parameters

input

Stream

The input.

Returns

Workbook

The imported workbook.

Overrides WorkbookFormatProviderBase.ImportOverride(Stream)

ImportOverride(Stream, CancellationToken)

Reads an .xlsm file from the stream with cancellation support, constructing a Workbook instance while preserving VBA macros.

Declaration

cs-api-definition
protected override Workbook ImportOverride(Stream input, CancellationToken cancellationToken)

Parameters

input

Stream

The input.

cancellationToken

CancellationToken

The cancellation token used to cancel the operation.

Returns

Workbook

The imported workbook.

Overrides WorkbookFormatProviderBase.ImportOverride(Stream, CancellationToken)