New to Telerik Document ProcessingStart a free 30-day trial

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:

C#
public class XlsmFormatProvider : BinaryWorkbookFormatProviderBase, IBinaryWorkbookFormatProvider, IWorkbookFormatProvider

Inheritance: objectWorkbookFormatProviderBaseBinaryWorkbookFormatProviderBaseXlsmFormatProvider

Implements: IBinaryWorkbookFormatProviderIWorkbookFormatProvider

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

Constructors

Initializes a new instance of the XlsmFormatProvider class.

C#
public XlsmFormatProvider()

Methods

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

C#
protected override void ExportOverride(Workbook workbook, Stream output, CancellationToken cancellationToken)
Parameters:workbookWorkbook

The workbook.

outputStream

The output.

cancellationTokenCancellationToken

The cancellation token used to cancel the operation.

Overrides: WorkbookFormatProviderBase.ExportOverride(Workbook, Stream, CancellationToken)

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

C#
protected override Workbook ImportOverride(Stream input, CancellationToken cancellationToken)
Parameters:inputStream

The input.

cancellationTokenCancellationToken

The cancellation token used to cancel the operation.

Returns:

Workbook

The imported workbook.

Overrides: WorkbookFormatProviderBase.ImportOverride(Stream, CancellationToken)

Properties

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

C#
public override bool CanExport { get; }
Property Value:

The value indicating whether can export.

Overrides: WorkbookFormatProviderBase.CanExport

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

C#
public override bool CanImport { get; }
Property Value:

The value indicating whether can import.

Overrides: WorkbookFormatProviderBase.CanImport

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

C#
public override string FilesDescription { get; }
Property Value:

The files description.

Overrides: WorkbookFormatProviderBase.FilesDescription

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

C#
public override string Name { get; }
Property Value:

The name of the provider.

Overrides: WorkbookFormatProviderBase.Name

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

C#
public override IEnumerable<string> SupportedExtensions { get; }
Property Value:

The supported extensions.

Overrides: WorkbookFormatProviderBase.SupportedExtensions