ExcelDocument
OfficeIMO.Excel
Represents an Excel document and provides methods for creating, loading and saving spreadsheets.
Inheritance
- object
- ExcelDocument
Usage
Explore 24 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 14
- Property ExcelCustomFormulaFunctionContext.Workbook
- Method ExcelDocument.ApplyTheme
- Method ExcelDocument.Create
- Method ExcelDocument.EnsureWorkbookTheme
- Method ExcelDocument.ImportSpreadsheetXml
- Method ExcelDocument.Load
- Method ExcelDocument.LoadAsync
- Method ExcelDocument.ResetWorkbookTheme
- Method ExcelDocument.SetWorkbookThemeName
- Method ExcelDocument.SetWorkbookThemeXml
- Property ExcelMacroProject.Document
- Property ExcelSheet.Document
- Method LegacySpreadsheetImportResult.RequireValue
- Property LegacySpreadsheetImportResult.Value
Accepted by parameters 10
- Constructor ExcelApplicationProperties.ExcelApplicationProperties
- Constructor ExcelBuiltinDocumentProperties.ExcelBuiltinDocumentProperties
- Extension method ExcelDocument.RowsAsParallel``1
- Extension method ExcelDocument.RowsAs``1
- Method ExcelDocument.CompareWorkbook
- Method ExcelDocument.CopyWorksheetFrom
- Method ExcelDocument.MergeWorkbookFrom
- Method ExcelDocumentMappingExtensions.RowsAsParallel``1
- Method ExcelDocumentMappingExtensions.RowsAs``1
- Method OfficeSheetSelector.ResolveMany
Constructors
public ExcelDocument() #Methods
public IReadOnlyDictionary<ExcelSheet, ExcelHyperlinkInfo> AddBackLinksToToc(string tocSheetName = "TOC", int row = 2, int col = 1, string text = "← TOC") #Adds a small back link to the TOC on each worksheet at the given cell (default A2).
Parameters
- tocSheetName string = "TOC"
- row int = 2
- col int = 1
- text string = "← TOC"
Returns
IReadOnlyDictionary<ExcelSheet, ExcelHyperlinkInfo>public ExcelMacroProject AddMacro(byte[] data) #Adds or replaces a vbaProject.bin payload.
Parameters
- data byte[]
Returns
ExcelMacroProjectpublic ExcelMacroProject AddMacro(string filePath) #Adds or replaces a VBA project from a file.
Parameters
- filePath string
Returns
ExcelMacroProjectpublic ExcelMacroProject AddMacro(Stream stream, long? maxBytes = null) #Adds or replaces a VBA project from a readable stream.
Parameters
- stream System.IO.Stream
- maxBytes long? = null
Returns
ExcelMacroProjectpublic ExcelPivotInteractionInfo AddPivotSlicer(string pivotTableName, string sourceField, string worksheetName, ExcelSlicerViewOptions? options = null) #Adds a native Excel slicer view bound to a PivotTable field.
Parameters
- pivotTableName string
- sourceField string
- worksheetName string
- options OfficeIMO.Excel.ExcelSlicerViewOptions? = null
Returns
ExcelPivotInteractionInfopublic ExcelPackagePartInfo AddPivotSlicerCache(string pivotTableName, string sourceField, string? cacheName = null) #Adds slicer cache metadata bound to a validated pivot table field.
Parameters
- pivotTableName string
- sourceField string
- cacheName string? = null
Returns
ExcelPackagePartInfopublic ExcelPivotInteractionInfo AddPivotTimeline(string pivotTableName, string sourceField, string worksheetName, ExcelTimelineViewOptions? options = null) #Adds a native Excel timeline view bound to a date-only PivotTable field.
Parameters
- pivotTableName string
- sourceField string
- worksheetName string
- options OfficeIMO.Excel.ExcelTimelineViewOptions? = null
Returns
ExcelPivotInteractionInfopublic ExcelPackagePartInfo AddPivotTimelineCache(string pivotTableName, string sourceField, string? cacheName = null) #Adds timeline cache metadata bound to a validated pivot table field.
Parameters
- pivotTableName string
- sourceField string
- cacheName string? = null
Returns
ExcelPackagePartInfopublic ExcelPowerQueryMetadataResult AddPowerQueryMetadata(ExcelPowerQueryMetadataOptions options) #Authors safe connection/query-table metadata for Excel-compatible applications to own and refresh. OfficeIMO writes metadata only; it does not execute Power Query M or contact external systems.
Parameters
- options OfficeIMO.Excel.ExcelPowerQueryMetadataOptions
public ExcelQueryBackedTableInfo AddQueryBackedTable(ExcelQueryBackedTableOptions options) #Creates a native query-backed worksheet table without executing its command.
Parameters
- options OfficeIMO.Excel.ExcelQueryBackedTableOptions
Returns
ExcelQueryBackedTableInfopublic ExcelSheet AddSheet(string worksheetName = "") #Adds a worksheet to the document.
Parameters
- worksheetName string = ""
- Worksheet name.
public ExcelSheet AddSheet(string worksheetName, ExcelSheetNameValidationMode validationMode) #Adds a worksheet to the document with control over name validation.
Parameters
- worksheetName string
- Requested worksheet name.
- validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode
- How to validate the sheet name: None (no checks), Sanitize (coerce), or Strict (throw on invalid).
public ExcelSheet AddSheet(string worksheetName, ExcelSheetNameValidationMode validationMode, CancellationToken cancellationToken) #Adds a worksheet, observing cancellation while earlier deferred worksheet data is materialized.
Parameters
- worksheetName string
- Requested worksheet name.
- validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode
- How to validate the worksheet name.
- cancellationToken System.Threading.CancellationToken
- Cancels deferred materialization and worksheet creation.
Exceptions
OperationCanceledException– The operation was canceled.
public ExcelSheet AddTableOfContents(string sheetName = "TOC", bool placeFirst = true, bool withHyperlinks = true, bool includeNamedRanges = false, bool includeHiddenNamedRanges = false, Predicate<string>? rangeNameFilter = null, bool styled = true) #Adds or refreshes a visually styled Table of Contents sheet with hyperlinks.
Parameters
- sheetName string = "TOC"
- TOC sheet name.
- placeFirst bool = true
- Move TOC as the first sheet.
- withHyperlinks bool = true
- Create internal hyperlinks.
- includeNamedRanges bool = false
- Also list defined names in a dedicated column.
- includeHiddenNamedRanges bool = false
- When listing defined names, include ones marked Hidden.
- rangeNameFilter System.Predicate<string>? = null
- Optional filter to include only matching defined names.
- styled bool = true
- When true, renders a banner and a formatted table with AutoFilter.
Returns
ExcelSheetpublic ExcelPackagePartInfo AddWorkbookConnectionMetadata(string xml) #Adds caller-supplied workbook connection metadata XML as a workbook package part. OfficeIMO preserves this metadata but does not execute or refresh external connections.
Parameters
- xml string
- Connection metadata XML.
public ExcelPackagePartInfo AddWorkbookMetadataPart(string relationshipType, string contentType, string xml, string targetExtension = "xml") #Adds caller-supplied XML as a workbook package metadata part.
Parameters
- relationshipType string
- Open XML relationship type.
- contentType string
- Package part content type.
- xml string
- Metadata XML.
- targetExtension string = "xml"
- Target extension for the generated package part.
public ExcelPackagePartInfo AddWorkbookSlicerCache(ExcelSlicerCacheOptions options) #Adds OfficeIMO-owned workbook-level slicer binding metadata. This does not impersonate a native Excel slicer-cache part; native cache structures and UI shapes must be materialized separately.
Parameters
- options OfficeIMO.Excel.ExcelSlicerCacheOptions
- Slicer cache metadata options.
public ExcelPackagePartInfo AddWorkbookTimelineCache(ExcelTimelineCacheOptions options) #Adds OfficeIMO-owned workbook-level timeline binding metadata. This does not impersonate a native Excel timeline-cache part; native cache structures and UI shapes must be materialized separately.
Parameters
- options OfficeIMO.Excel.ExcelTimelineCacheOptions
- Timeline cache metadata options.
public ExcelPackagePartInfo AddWorksheetMetadataPart(ExcelSheet sheet, string relationshipType, string contentType, string xml, string targetExtension = "xml") #Adds caller-supplied XML as a worksheet package metadata part.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- Worksheet that owns the metadata part.
- relationshipType string
- Open XML relationship type.
- contentType string
- Package part content type.
- xml string
- Metadata XML.
- targetExtension string = "xml"
- Target extension for the generated package part.
public ExcelPackagePartInfo AddWorksheetQueryTableMetadata(string worksheetName, string xml) #Adds caller-supplied query-table metadata XML as a worksheet package part. OfficeIMO preserves this metadata but does not execute or refresh external queries.
Parameters
- worksheetName string
- Worksheet that owns the query-table metadata.
- xml string
- Query-table metadata XML.
public ExcelAccessibilityReport AnalyzeAccessibility() #Reports workbook accessibility and compliance issues such as missing alt text, hidden sheets, merged cells, and missing table headers.
Returns
ExcelAccessibilityReportpublic ExcelFormulaAnalysisReport AnalyzeFormulas() #Analyzes formulas for references, opening brackets that may indicate special references, and volatile functions.
Returns
ExcelFormulaAnalysisReportpublic int ApplyTemplate(IDictionary<string, object?> values, IFormatProvider? provider = null, bool throwOnMissing = false) #Replaces {{Marker}} placeholders across all worksheets using the supplied values.
Parameters
- values System.Collections.Generic.IDictionary<string, object?>
- provider System.IFormatProvider? = null
- throwOnMissing bool = false
Returns
intpublic int ApplyTemplate(IDictionary<string, object?> values, ExcelTemplateOptions options) #Replaces {{Marker}} placeholders across all worksheets using the supplied values and options.
Parameters
- values System.Collections.Generic.IDictionary<string, object?>
- options OfficeIMO.Excel.ExcelTemplateOptions
Returns
intpublic int ApplyTemplate(object model, IFormatProvider? provider = null, bool throwOnMissing = false) #Replaces {{Marker}} placeholders across all worksheets using public properties from the supplied model. Nested properties are exposed as dotted marker names, for example {{Customer.Name}}.
Parameters
- model object
- provider System.IFormatProvider? = null
- throwOnMissing bool = false
Returns
intpublic int ApplyTemplate(object model, ExcelTemplateOptions options) #Replaces {{Marker}} placeholders across all worksheets using public properties from the supplied model and options. Nested properties are exposed as dotted marker names, for example {{Customer.Name}}.
Parameters
- model object
- options OfficeIMO.Excel.ExcelTemplateOptions
Returns
intpublic int ApplyTemplateSheets(string templateSheetName, IEnumerable<IDictionary<string, object?>> sheets, Func<IDictionary<string, object?>, int, string>? sheetNameSelector = null, ExcelTemplateOptions? options = null) #Repeats a template worksheet for each supplied value dictionary and applies markers to each generated sheet.
Parameters
- templateSheetName string
- Worksheet to use as the sheet template.
- sheets System.Collections.Generic.IEnumerable<System.Collections.Generic.IDictionary<string, object?>>
- Per-sheet value dictionaries.
- sheetNameSelector System.Func<System.Collections.Generic.IDictionary<string, object?>, int, string>? = null
- Optional generated sheet name selector. The index is zero-based.
- options OfficeIMO.Excel.ExcelTemplateOptions? = null
- Optional template binding options.
Returns
int Total marker replacements across all generated sheets.public int ApplyTemplateSheets<T>(string templateSheetName, IEnumerable<T?> models, Func<T?, int, string>? sheetNameSelector = null, ExcelTemplateOptions? options = null) #Repeats a template worksheet for each supplied model and applies markers to each generated sheet. Public properties are exposed as marker names, including nested dotted names.
Type Parameters
- T
Parameters
- templateSheetName string
- Worksheet to use as the sheet template.
- models System.Collections.Generic.IEnumerable<T?>
- Per-sheet models.
- sheetNameSelector System.Func<T?, int, string>? = null
- Optional generated sheet name selector. The index is zero-based.
- options OfficeIMO.Excel.ExcelTemplateOptions? = null
- Optional template binding options.
Returns
int Total marker replacements across all generated sheets.public ExcelDocument ApplyTheme(OfficeTheme theme) #Applies the shared palette and font scheme to the workbook and uses it for subsequent authoring defaults.
Parameters
- theme OfficeIMO.OfficeTheme
Returns
ExcelDocumentpublic int Calculate() #Calculates formulas that are supported by OfficeIMO's lightweight formula engine and writes cached values. Unsupported formulas are preserved unchanged for Excel-compatible applications to calculate.
Returns
int The number of formula cells with updated cached values.public void ClearCachedFormulaResults() #Removes cached values from all formula cells.
public void ClearWriteReservation() #Removes workbook write-reservation metadata.
public IReadOnlyList<ExcelRangeDifference> CompareRanges(ExcelSheet leftSheet, string leftRange, ExcelSheet rightSheet, string rightRange, ExcelRangeCompareOptions? options = null) #Compares two worksheet ranges and returns cell-level differences.
Parameters
- leftSheet OfficeIMO.Excel.ExcelSheet
- leftRange string
- rightSheet OfficeIMO.Excel.ExcelSheet
- rightRange string
- options OfficeIMO.Excel.ExcelRangeCompareOptions? = null
Returns
IReadOnlyList<ExcelRangeDifference>public ExcelWorkbookDiffReport CompareWorkbook(ExcelDocument other, ExcelWorkbookDiffOptions options) #Compares this workbook with another workbook using configurable structural, value, style, table, comment, and metadata checks.
Parameters
- other OfficeIMO.Excel.ExcelDocument
- options OfficeIMO.Excel.ExcelWorkbookDiffOptions
Returns
ExcelWorkbookDiffReportpublic ExcelWorkbookDiffReport CompareWorkbook(ExcelDocument other, int maxDifferences = 200) #Compares this workbook with another workbook by sheets, dimensions, formulas, and visible cell text.
Parameters
- other OfficeIMO.Excel.ExcelDocument
- Workbook to compare with this workbook.
- maxDifferences int = 200
- Maximum number of differences to record. A nonpositive value records no differences.
public IReadOnlyList<ExcelRangeDifference> CompareWorksheets(ExcelSheet leftSheet, ExcelSheet rightSheet, ExcelRangeCompareOptions? options = null) #Compares the used ranges of two worksheets.
Parameters
- leftSheet OfficeIMO.Excel.ExcelSheet
- rightSheet OfficeIMO.Excel.ExcelSheet
- options OfficeIMO.Excel.ExcelRangeCompareOptions? = null
Returns
IReadOnlyList<ExcelRangeDifference>public void ConfigureFullCalculationOnOpen() #Requests a full workbook recalculation when the file is opened.
public ExcelSheet CopyWorksheet(string sourceSheetName, string newSheetName, ExcelSheetNameValidationMode validationMode = Sanitize) #Copies a worksheet within this workbook. Self-qualified references in the copy target the new worksheet; references to other sheets remain unchanged.
Parameters
- sourceSheetName string
- Name of the worksheet to copy.
- newSheetName string
- Requested name for the copied worksheet.
- validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode = Sanitize
- How to validate or sanitize newSheetName.
public ExcelSheet CopyWorksheet(ExcelSheet sourceSheet, string newSheetName, ExcelSheetNameValidationMode validationMode = Sanitize) #Copies a worksheet within this workbook. Self-qualified references in the copy target the new worksheet; references to other sheets remain unchanged.
Parameters
- sourceSheet OfficeIMO.Excel.ExcelSheet
- Worksheet to copy.
- newSheetName string
- Requested name for the copied worksheet.
- validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode = Sanitize
- How to validate or sanitize newSheetName.
public ExcelSheet CopyWorksheetFrom(ExcelDocument sourceDocument, string sourceSheetName, string newSheetName, ExcelSheetNameValidationMode validationMode = Sanitize) #Copies a worksheet from another workbook into this workbook.
Parameters
- sourceDocument OfficeIMO.Excel.ExcelDocument
- Workbook containing the source worksheet.
- sourceSheetName string
- Name of the worksheet to copy.
- newSheetName string
- Requested name for the copied worksheet.
- validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode = Sanitize
- How to validate or sanitize newSheetName.
public ExcelSheet CopyWorksheetFrom(ExcelDocument sourceDocument, string sourceSheetName, string newSheetName, ExcelSheetNameValidationMode validationMode, ExcelWorksheetCopyOptions? options) #Copies a worksheet from another workbook into this workbook.
Parameters
- sourceDocument OfficeIMO.Excel.ExcelDocument
- Workbook containing the source worksheet.
- sourceSheetName string
- Name of the worksheet to copy.
- newSheetName string
- Requested name for the copied worksheet.
- validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode
- How to validate or sanitize newSheetName.
- options OfficeIMO.Excel.ExcelWorksheetCopyOptions?
- Copy strategy options.
public static ExcelDocument Create(ExcelCreateOptions? options = null) #Creates a detached workbook that must be saved explicitly to a path or stream.
Parameters
- options OfficeIMO.Excel.ExcelCreateOptions? = null
- Creation options. SaveOnDispose is invalid without an associated destination.
Returns
ExcelDocumentpublic static ExcelDocument Create(string filePath, ExcelCreateOptions? options = null) #Creates a new Excel document at the specified path.
Parameters
- filePath string
- Path to the new file.
- options OfficeIMO.Excel.ExcelCreateOptions? = null
- Creation and persistence options.
public static ExcelDocument Create(Stream stream, ExcelCreateOptions? options = null) #Creates a new Excel document in memory and optionally persists it to the provided stream on dispose.
Parameters
- stream System.IO.Stream
- Destination stream to receive the workbook package.
- options OfficeIMO.Excel.ExcelCreateOptions? = null
- Creation and persistence options.
public ExcelWorkbookDataReader CreateDataReader(ExcelReaderOptions? options = null) #Creates a forward-only data reader over this open workbook document. The returned reader does not close the document.
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
Returns
ExcelWorkbookDataReaderpublic static ExcelWorkbookWriter CreateWriter(string path, ExcelWriterOptions? options = null, OfficeTheme? theme = null) #Creates a bounded-memory XLSX writer. Dispose publishes the completed file atomically.
Parameters
- path string
- options OfficeIMO.Excel.ExcelWriterOptions? = null
- theme OfficeIMO.OfficeTheme? = null
Returns
ExcelWorkbookWriterpublic static ExcelWorkbookWriter CreateWriter(ExcelFileFormat format, string path, ExcelWriterOptions? options = null, OfficeTheme? theme = null) #Creates a row writer for the selected Excel format. Dispose publishes the file atomically.
Parameters
- format OfficeIMO.Excel.ExcelFileFormat
- path string
- options OfficeIMO.Excel.ExcelWriterOptions? = null
- theme OfficeIMO.OfficeTheme? = null
Returns
ExcelWorkbookWriterpublic static ExcelWorkbookWriter CreateWriter(Stream stream, ExcelWriterOptions? options = null, OfficeTheme? theme = null, bool leaveOpen = false) #Creates a bounded-memory XLSX writer over a writable stream, including non-seekable streams.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelWriterOptions? = null
- theme OfficeIMO.OfficeTheme? = null
- leaveOpen bool = false
Returns
ExcelWorkbookWriterpublic static ExcelWorkbookWriter CreateWriter(ExcelFileFormat format, Stream stream, ExcelWriterOptions? options = null, OfficeTheme? theme = null, bool leaveOpen = false) #Creates a row writer for the selected format over a writable, optionally non-seekable stream.
Parameters
- format OfficeIMO.Excel.ExcelFileFormat
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelWriterOptions? = null
- theme OfficeIMO.OfficeTheme? = null
- leaveOpen bool = false
Returns
ExcelWorkbookWriterpublic ExcelNamedStyleInfo DefineNamedStyle(string name, ExcelStyleDefinition definition, bool hidden = false) #Creates or replaces a custom named style from a standalone definition. Existing cells using the unchanged named style receive the replacement formatting.
Parameters
- name string
- definition OfficeIMO.Excel.ExcelStyleDefinition
- hidden bool = false
Returns
ExcelNamedStyleInfopublic async ValueTask DisposeAsync() #Asynchronously releases resources used by the document.
Returns
ValueTaskpublic ExcelDocument EnsureWorkbookTheme() #Ensures the workbook contains the shared default theme and stylesheet parts.
Returns
ExcelDocumentpublic OfficeConversionResult<byte[], ExcelSpreadsheetXmlReport> ExportSpreadsheetXml(ExcelSpreadsheetXmlOptions? options = null) #Exports the current workbook to XML Spreadsheet 2003 data interchange bytes and reports unsupported content. Does not change the associated file path. XML is a separate explicit route, not an alias for XLSX Save.
Parameters
- options OfficeIMO.Excel.ExcelSpreadsheetXmlOptions? = null
Returns
OfficeConversionResult<byte[], ExcelSpreadsheetXmlReport>public byte[] ExtractEmbeddedPayload(string id, long? maxBytes = null) #Extracts an embedded payload by its package-local id.
Parameters
- id string
- maxBytes long? = null
Returns
byte[]public byte[] ExtractMacros(long? maxBytes = null) #Extracts the VBA project, or an empty array when no project exists.
Parameters
- maxBytes long? = null
Returns
byte[]public IReadOnlyDictionary<string, string> GetAllNamedRanges(ExcelSheet? scope = null) #Returns all defined names with their A1 ranges, optionally limited to a sheet scope.
Parameters
- scope OfficeIMO.Excel.ExcelSheet? = null
Returns
IReadOnlyDictionary<string, string>public IReadOnlyList<OfficeEmbeddedPayloadInfo> GetEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions options, CancellationToken cancellationToken = default) #Inventories payloads within explicit count/member/aggregate/work ceilings without scanning unrequested bytes unless hashing is requested.
Parameters
- options OfficeIMO.OfficeEmbeddedPayloadInspectionOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
IReadOnlyList<OfficeEmbeddedPayloadInfo>public IReadOnlyList<OfficeEmbeddedPayloadInfo> GetEmbeddedPayloads(bool includeSha256 = false) #Gets embedded package, OLE, and ActiveX payload metadata.
Parameters
- includeSha256 bool = false
Returns
IReadOnlyList<OfficeEmbeddedPayloadInfo>public ExcelRange? GetNamedRange(string name, ExcelSheet? scope = null) #Returns the range a defined name refers to, on the worksheet the name points at. When scope is supplied, a name local to that sheet wins over a workbook name.
Parameters
- name string
- Defined name to resolve.
- scope OfficeIMO.Excel.ExcelSheet? = null
- Optional sheet scope to resolve a local name.
Returns
ExcelRange? The range, or null when the name does not exist or does not refer to one rectangular cell range on an existing worksheet (for example a constant, a formula or a #REF! reference). Use ExcelDocument.ListNamedRanges for the stored text of every name.public IReadOnlyList<ExcelNamedStyleInfo> GetNamedStyles() #Lists workbook named styles.
Returns
IReadOnlyList<ExcelNamedStyleInfo>public IReadOnlyList<ExcelPivotInteractionInfo> GetPivotInteractions() #Returns native slicer and timeline views across the workbook.
Returns
IReadOnlyList<ExcelPivotInteractionInfo>public IReadOnlyList<ExcelPivotTableInfo> GetPivotTables() #Returns all pivot tables defined in the workbook.
Returns
IReadOnlyList<ExcelPivotTableInfo>public IReadOnlyList<ExcelQueryBackedTableInfo> GetQueryBackedTables() #Lists query-backed worksheet tables that have a resolvable native query-table relationship.
Returns
IReadOnlyList<ExcelQueryBackedTableInfo>public ExcelSheet GetSheet(string name) #Gets a worksheet by name.
Parameters
- name string
Returns
ExcelSheetpublic IReadOnlyList<string> GetSheetNames() #Returns worksheet names in workbook order.
Returns
IReadOnlyList<string>public ExcelStreamingContractReport GetStreamingContract() #Returns a streaming/read-write contract summary for large workbook workflows.
Returns
ExcelStreamingContractReportpublic IReadOnlyList<ExcelTableInfo> GetTables() #Returns all Excel tables defined in the workbook.
Returns
IReadOnlyList<ExcelTableInfo>public IReadOnlyList<ExcelPivotInteractionCacheInfo> GetWorkbookSlicerCaches() #Returns workbook-level slicer cache metadata parts.
Returns
IReadOnlyList<ExcelPivotInteractionCacheInfo>public ExcelWorkbookThemeInfo GetWorkbookTheme(bool includeXml = false) #Gets workbook theme metadata and optionally includes the raw theme XML.
Parameters
- includeXml bool = false
Returns
ExcelWorkbookThemeInfopublic string? GetWorkbookThemeXml() #Gets the raw workbook theme XML when a theme part exists.
Returns
string?public IReadOnlyList<ExcelPivotInteractionCacheInfo> GetWorkbookTimelineCaches() #Returns workbook-level timeline cache metadata parts.
Returns
IReadOnlyList<ExcelPivotInteractionCacheInfo>public ExcelWorkbookWriteReservationInfo GetWriteReservation() #Gets workbook write-reservation metadata. This is separate from workbook protection and package encryption.
public static OfficeConversionResult<ExcelDocument, ExcelSpreadsheetXmlReport> ImportSpreadsheetXml(string filePath, ExcelSpreadsheetXmlOptions? options = null) #Imports a bounded XML Spreadsheet 2003 file into the normal editable workbook model. Unsupported features are reported, never evaluated. The caller owns the returned workbook.
Parameters
- filePath string
- options OfficeIMO.Excel.ExcelSpreadsheetXmlOptions? = null
Returns
OfficeConversionResult<ExcelDocument, ExcelSpreadsheetXmlReport>public static OfficeConversionResult<ExcelDocument, ExcelSpreadsheetXmlReport> ImportSpreadsheetXml(byte[] input, ExcelSpreadsheetXmlOptions? options = null) #Imports XML Spreadsheet bytes with operation-level fidelity diagnostics.
Parameters
- input byte[]
- options OfficeIMO.Excel.ExcelSpreadsheetXmlOptions? = null
Returns
OfficeConversionResult<ExcelDocument, ExcelSpreadsheetXmlReport>public static OfficeConversionResult<ExcelDocument, ExcelSpreadsheetXmlReport> ImportSpreadsheetXml(Stream input, ExcelSpreadsheetXmlOptions? options = null) #Imports the remaining bytes of a readable stream. The stream remains open and its position advances. Use ThrowIfLoss on the result when omissions must reject the workflow; dispose its Value even on rejection.
Parameters
- input System.IO.Stream
- options OfficeIMO.Excel.ExcelSpreadsheetXmlOptions? = null
Returns
OfficeConversionResult<ExcelDocument, ExcelSpreadsheetXmlReport>public IReadOnlyList<ExcelDataSetImportResult> InsertDataSet(DataSet dataSet, bool createTables = true, ExcelTableStyle tableStyle = TableStyleMedium2, bool includeHeaders = true, bool includeAutoFilter = true, bool autoFit = false, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Imports a DataSet into the workbook with one worksheet per source DataTable.
Parameters
- dataSet System.Data.DataSet
- Source dataset.
- createTables bool = true
- Create an Excel table over each imported DataTable.
- tableStyle OfficeIMO.Excel.ExcelTableStyle = TableStyleMedium2
- Excel table style to use when createTables is true.
- includeHeaders bool = true
- Write source column names as the first row.
- includeAutoFilter bool = true
- Include table AutoFilter dropdowns when creating tables.
- autoFit bool = false
- Auto-fit imported columns after each sheet is created.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Optional execution mode override for DataTable writes.
- ct System.Threading.CancellationToken = default
- Cancellation token.
Returns
IReadOnlyList<ExcelDataSetImportResult> Import results describing the created worksheets and ranges.public ExcelWorkbookInfo Inspect(ExcelReaderOptions? options = null) #Creates an immutable workbook snapshot that exposes OfficeIMO's current workbook model for downstream integrations.
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
Returns
ExcelWorkbookInfopublic ExcelWorkbookInfo Inspect(ExcelReaderOptions? options, CancellationToken cancellationToken) #Creates the native immutable workbook snapshot with cancellation between source sheets, rows and cells.
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions?
- cancellationToken System.Threading.CancellationToken
Returns
ExcelWorkbookInfopublic ExcelWorkbookCommentReport InspectComments() #Audits legacy notes and threaded comments across the workbook.
Returns
ExcelWorkbookCommentReportpublic ExcelDataModelReport InspectDataModel() #Inspects data model, Power Query, connection, query table, and external link package parts.
Returns
ExcelDataModelReportpublic OfficeEmbeddedPayloadInspection InspectEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions? options = null, CancellationToken cancellationToken = default) #Inventories inert native payloads and creates a bounded cumulative read session. Keep this document open for new reads; returned streams are detached and caller-owned.
Parameters
- options OfficeIMO.OfficeEmbeddedPayloadInspectionOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeEmbeddedPayloadInspectionpublic ExcelFeatureReport InspectFeatures() #Inspects workbook features and reports which ones OfficeIMO can edit, partially edit, preserve, or does not support yet.
Returns
ExcelFeatureReportpublic ExcelFormulaInspection InspectFormulas() #Inspects formula cells across all worksheets without changing workbook contents.
Returns
ExcelFormulaInspectionpublic OfficeContentSafetyReport InspectLoadedContentSafety(OfficeContentSafetyOptions? options = null, CancellationToken cancellationToken = default) #Inspects the currently loaded workbook without reopening, calculating formulas, refreshing links, or saving. Source-load limits remain the caller's responsibility.
Parameters
- options OfficeIMO.ContentSafety.OfficeContentSafetyOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeContentSafetyReportpublic ExcelSignatureInfo InspectSignatures() #Inspects package-level digital-signature metadata without validating cryptographic trust.
Returns
ExcelSignatureInfopublic ExcelTemplateInspection InspectTemplate() #Inspects {{Marker}} placeholders across all worksheets without modifying the workbook.
Returns
ExcelTemplateInspectionpublic ExcelTemplateInspection InspectTemplate(IDictionary<string, object?> values) #Inspects {{Marker}} placeholders across all worksheets and reports which markers are missing from the supplied values.
Parameters
- values System.Collections.Generic.IDictionary<string, object?>
Returns
ExcelTemplateInspectionpublic ExcelTemplateInspection InspectTemplate(object model) #Inspects {{Marker}} placeholders across all worksheets and reports which markers are missing from public properties on the supplied model.
Parameters
- model object
Returns
ExcelTemplateInspectionpublic OfficeVbaProjectInfo? InspectVbaProject(bool includeSha256 = false) #Inspects the attached VBA project without executing macro code.
Parameters
- includeSha256 bool = false
Returns
OfficeVbaProjectInfo?public OfficeVbaProjectInfo? InspectVbaProject(bool includeSha256, long maxBytes) #Inspects the attached VBA project while enforcing a decoded byte limit.
Parameters
- includeSha256 bool
- maxBytes long
Returns
OfficeVbaProjectInfo?public OfficeVbaProjectInfo? InspectVbaProjectMetadata() #Inventories the VBA part and signature relationship without reading its bytes or decoding module names. Payload length remains unknown.
Returns
OfficeVbaProjectInfo?public void InvalidateFormulas() #Marks all formulas dirty so Excel-compatible applications recalculate them on open.
public IReadOnlyList<ExcelNamedRangeInfo> ListNamedRanges(bool includeBuiltIn = true, bool includeHidden = true) #Returns all workbook and sheet-scoped defined names with scope and hidden metadata.
Parameters
- includeBuiltIn bool = true
- includeHidden bool = true
Returns
IReadOnlyList<ExcelNamedRangeInfo>public static ExcelDocument Load(string filePath, ExcelLoadOptions? options = null) #Loads an existing Excel document.
Parameters
- filePath string
- Path to the file.
- options OfficeIMO.Excel.ExcelLoadOptions? = null
- Access, persistence, and low-level package options.
public static ExcelDocument Load(Stream stream, ExcelLoadOptions? options = null) #Loads an existing Excel document from the provided stream.
Parameters
- stream System.IO.Stream
- Input stream containing the workbook package. Editable writable seekable sources become the associated destination; other sources remain detached.
- options OfficeIMO.Excel.ExcelLoadOptions? = null
- Access, persistence, and low-level package options.
public static ExcelDocument Load(string path, ExcelLoadOptions? options, out OfficeConversionReport report) #Loads a workbook and returns findings from its source projection.
Parameters
- path string
- options OfficeIMO.Excel.ExcelLoadOptions?
- report OfficeIMO.OfficeConversionReport
Returns
ExcelDocumentpublic static ExcelDocument Load(Stream stream, ExcelLoadOptions? options, out OfficeConversionReport report) #Loads a workbook stream and returns findings from its source projection.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelLoadOptions?
- report OfficeIMO.OfficeConversionReport
Returns
ExcelDocumentpublic static ExcelDocument Load(string path, ExcelLoadOptions? options, CancellationToken cancellationToken) #Loads a workbook with cancellation during native XLSB record projection.
Parameters
- path string
- options OfficeIMO.Excel.ExcelLoadOptions?
- cancellationToken System.Threading.CancellationToken
Returns
ExcelDocumentpublic static ExcelDocument Load(Stream stream, ExcelLoadOptions? options, CancellationToken cancellationToken) #Loads a caller-owned stream with cancellation during native XLSB record projection.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelLoadOptions?
- cancellationToken System.Threading.CancellationToken
Returns
ExcelDocumentpublic static async Task<ExcelDocument> LoadAsync(string filePath, ExcelLoadOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an Excel document from the specified path.
Parameters
- filePath string
- Path to the Excel file.
- options OfficeIMO.Excel.ExcelLoadOptions? = null
- Access, persistence, and low-level package options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token.
Exceptions
FileNotFoundException– Thrown when the file does not exist.
public static async Task<ExcelDocument> LoadAsync(Stream stream, ExcelLoadOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an Excel document from the provided stream.
Parameters
- stream System.IO.Stream
- Input stream containing the workbook package. Editable writable seekable sources become the associated destination; other sources remain detached.
- options OfficeIMO.Excel.ExcelLoadOptions? = null
- Access, persistence, and low-level package options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token.
public static async Task<ExcelDocument> LoadAsync(Uri uri, ExcelLoadOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an Excel workbook from a remote URI.
Parameters
- uri System.Uri
- HTTP or HTTPS URI of the workbook.
- options OfficeIMO.Excel.ExcelLoadOptions? = null
- Access, persistence, and low-level package options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token.
public ExcelWorkbookMergeResult MergeWorkbookFrom(ExcelDocument sourceDocument, ExcelWorkbookMergeOptions? options = null) #Imports selected or all worksheets from another workbook into this workbook.
Parameters
- sourceDocument OfficeIMO.Excel.ExcelDocument
- options OfficeIMO.Excel.ExcelWorkbookMergeOptions? = null
Returns
ExcelWorkbookMergeResultpublic ExcelWorksheetMergeResult MergeWorksheets(ExcelSheet targetSheet, ExcelSheet sourceSheet, ExcelWorksheetMergeOptions? options = null) #Merges source worksheet rows into a target worksheet by appending or writing to a requested target position. This is a workbook operation over worksheet values; callers own any data shaping or relational joins before writing.
Parameters
- targetSheet OfficeIMO.Excel.ExcelSheet
- sourceSheet OfficeIMO.Excel.ExcelSheet
- options OfficeIMO.Excel.ExcelWorksheetMergeOptions? = null
Returns
ExcelWorksheetMergeResultpublic static string NormalizeDefinedName(string name, ExcelDefinedNameValidationMode mode = Sanitize) #Ensures a defined name complies with Excel rules. In Sanitize mode, returns a corrected name. Throws in Strict mode when input is invalid. Rules: - 1..255 characters - First char must be a letter, underscore, or backslash - Allowed characters: letters, digits, underscore, period, backslash - Cannot look like a cell reference (e.g., A1, AA10) or an R1C1 reference - Cannot be TRUE or FALSE (case-insensitive)
Parameters
- name string
- Authored workbook defined name.
- mode OfficeIMO.Excel.ExcelDefinedNameValidationMode = Sanitize
- Whether invalid names are sanitized or rejected.
Returns
string The exact defined name that can be emitted to the workbook.public Stream OpenEmbeddedPayload(string id, long maximumBytes, CancellationToken cancellationToken = default) #Opens a complete bounded read-only detached payload stream. The caller owns its lifetime; no external target is accessed.
Parameters
- id string
- maximumBytes long
- cancellationToken System.Threading.CancellationToken = default
Returns
Streampublic void OpenInApplication(string? filePath = null) #Opens the associated workbook in the operating system's registered application.
Parameters
- filePath string? = null
public static ExcelWorkbookDataReader OpenReader(string path, ExcelReaderOptions? options = null) #Opens an XLSX, XLSM, XLTX, XLTM, XLAM, XLSB, or BIFF8 XLS workbook as a forward-only data reader. Worksheets are exposed in workbook order through DbDataReader.NextResult.
Parameters
- path string
- options OfficeIMO.Excel.ExcelReaderOptions? = null
Returns
ExcelWorkbookDataReaderpublic static ExcelWorkbookDataReader OpenReader(Stream stream, ExcelReaderOptions? options = null) #Opens an XLSX, XLSM, XLTX, XLTM, XLAM, XLSB, or BIFF8 XLS workbook stream as a forward-only data reader. The format is detected from the package rather than the file name. The input stream remains open after the returned reader is disposed.
Parameters
- stream System.IO.Stream
- Readable workbook stream positioned at the workbook bytes to read.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Workbook reader options.
public static async Task<ExcelWorkbookDataReader> OpenReaderAsync(string path, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously reads a local XLSX, XLSM, XLTX, XLTM, XLAM, XLSB, or BIFF8 XLS file and opens it as a forward-only data reader.
Parameters
- path string
- Workbook path with a supported Excel extension.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Worksheet selection, reader limits, conversion, and cancellation settings.
- cancellationToken System.Threading.CancellationToken = default
- Cancels opening and remains active for the returned reader.
Returns
Task<ExcelWorkbookDataReader> A reader owned by the caller. The input file is closed before this task completes.public static Task<ExcelWorkbookDataReader> OpenReaderAsync(Stream stream, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously reads the remaining workbook bytes from a stream and opens a forward-only data reader. The physical XLSX, XLSM, XLTX, XLTM, XLAM, XLSB, or BIFF8 XLS format is detected from those bytes.
Parameters
- stream System.IO.Stream
- Readable stream positioned at the workbook bytes to read.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Worksheet selection, reader limits, conversion, and cancellation settings.
- cancellationToken System.Threading.CancellationToken = default
- Cancels opening and remains active for the returned reader.
public static async Task<ExcelWorkbookDataReader> OpenReaderAsync(Uri uri, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Downloads an HTTP or HTTPS workbook and opens it as a forward-only data reader.
Parameters
- uri System.Uri
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelWorkbookDataReader>public void PreflightWorkbook() #Performs a safety preflight across all worksheets to reduce the likelihood of Excel prompting for repairs on open. It removes empty containers (Hyperlinks/MergeCells), drops orphaned drawing and header/footer references, and cleans up invalid table references.
public void ProtectWorkbook(ExcelWorkbookProtectionOptions? options = null) #Protects workbook structure/window metadata. This is not file encryption.
Parameters
- options OfficeIMO.Excel.ExcelWorkbookProtectionOptions? = null
public OfficeVbaProject? ReadVbaProject(OfficeVbaReadOptions? options = null) #Reads a detached, editable native VBA project; returns null when no project exists.
Parameters
- options OfficeIMO.OfficeVbaReadOptions? = null
Returns
OfficeVbaProject?public int RecalculateSupportedFormulas() #Evaluates supported formulas and writes cached values.
Returns
intpublic async Task<IReadOnlyList<ExcelQueryRefreshResult>> RefreshQueriesAsync(IExcelQueryExecutionHost host, ExcelQueryExecutionPolicy policy, CancellationToken cancellationToken = default) #Refreshes all query-backed tables sequentially through one explicit caller host and policy.
Parameters
- host OfficeIMO.Excel.IExcelQueryExecutionHost
- policy OfficeIMO.Excel.ExcelQueryExecutionPolicy
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<IReadOnlyList<ExcelQueryRefreshResult>>public async Task<ExcelQueryRefreshResult> RefreshQueryAsync(string connectionOrTableName, IExcelQueryExecutionHost host, ExcelQueryExecutionPolicy policy, CancellationToken cancellationToken = default) #Executes one query through an explicit caller host and atomically replaces its owned table data.
Parameters
- connectionOrTableName string
- host OfficeIMO.Excel.IExcelQueryExecutionHost
- policy OfficeIMO.Excel.ExcelQueryExecutionPolicy
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelQueryRefreshResult>public bool RemoveCustomDocumentProperty(string name) #Removes a custom workbook property.
Parameters
- name string
Returns
boolpublic bool RemoveEmbeddedPayload(string id) #Removes an embedded payload and known worksheet OLE/control markup that references it.
Parameters
- id string
Returns
boolpublic bool RemoveNamedRange(string name, ExcelSheet? scope = null, bool save = true) #Removes a defined name. If scope is provided, removes the sheet‑local name; otherwise the global name.
Parameters
- name string
- Defined name to remove.
- scope OfficeIMO.Excel.ExcelSheet? = null
- Optional sheet scope.
- save bool = true
- When true, saves the workbook after removal.
Returns
bool True if the name existed and was removed; otherwise false.public bool RemoveNamedStyle(string name) #Removes a custom named-style catalog entry without changing already formatted cells.
Parameters
- name string
Returns
boolpublic bool RemovePivotInteraction(string name, bool removeUnusedCache = true) #Removes one native slicer or timeline view and optionally its unused cache.
Parameters
- name string
- removeUnusedCache bool = true
Returns
boolpublic static OfficeProvenanceRemovalResult RemoveProvenance(string inputPath, string outputPath, OfficeProvenanceRemovalOptions? options = null) #Removes selected provenance and atomically writes an Open XML workbook.
Parameters
- inputPath string
- outputPath string
- options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null
Returns
OfficeProvenanceRemovalResultpublic static OfficeProvenanceRemovalResult RemoveProvenance(byte[] workbookBytes, string fileName = "workbook.xlsx", OfficeProvenanceRemovalOptions? options = null) #Removes selected provenance from encoded Open XML workbook bytes.
Parameters
- workbookBytes byte[]
- fileName string = "workbook.xlsx"
- options OfficeIMO.Provenance.OfficeProvenanceRemovalOptions? = null
Returns
OfficeProvenanceRemovalResultpublic bool RemoveQueryBackedTable(string connectionOrTableName, bool preserveTable = true) #Detaches a query binding and removes its unused OfficeIMO-owned connection, optionally converting the table to a normal cell range.
Parameters
- connectionOrTableName string
- preserveTable bool = true
Returns
boolpublic static OfficeContentCleanupResult RemoveSelectedContent(byte[] workbookBytes, OfficeContentCleanupSelection selection, string fileName = "workbook.xlsx", OfficeContentCleanupOptions? options = null) #Removes exact selected concealed-content findings and emits the same physical Excel format.
Parameters
- workbookBytes byte[]
- selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection
- fileName string = "workbook.xlsx"
- options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null
Returns
OfficeContentCleanupResultpublic static OfficeContentCleanupResult RemoveSelectedContent(string inputPath, string outputPath, OfficeContentCleanupSelection selection, OfficeContentCleanupOptions? options = null) #Atomically writes an explicitly cleaned Excel artifact.
Parameters
- inputPath string
- outputPath string
- selection OfficeIMO.ContentSafety.OfficeContentCleanupSelection
- options OfficeIMO.ContentSafety.OfficeContentCleanupOptions? = null
Returns
OfficeContentCleanupResultpublic void RemoveWorksheet(string sheetName) #Removes a worksheet by name, deleting its part and entry in the workbook.
Parameters
- sheetName string
public bool RenameNamedRange(string oldName, string newName, ExcelSheet? scope = null, ExcelDefinedNameValidationMode validationMode = Sanitize, bool save = true) #Renames an existing workbook or sheet-scoped defined name.
Parameters
- oldName string
- newName string
- scope OfficeIMO.Excel.ExcelSheet? = null
- validationMode OfficeIMO.Excel.ExcelDefinedNameValidationMode = Sanitize
- save bool = true
Returns
boolpublic void ReorderWorksheet(string sheetName, int targetIndex) #Reorders a worksheet by name using a zero-based target index.
Parameters
- sheetName string
- targetIndex int
public void ReorderWorksheet(ExcelSheet sheet, int targetIndex) #Reorders a worksheet using a zero-based target index.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- targetIndex int
public ExcelWorkbookRepairReport RepairWorkbook(ExcelWorkbookRepairOptions? options = null) #Runs safe workbook repairs using OfficeIMO's existing cleanup engines, then returns before/after diagnostics.
Parameters
- options OfficeIMO.Excel.ExcelWorkbookRepairOptions? = null
Returns
ExcelWorkbookRepairReportpublic void ReplaceEmbeddedPayload(string id, byte[] data) #Replaces an embedded payload while preserving its owner relationship.
Parameters
- id string
- data byte[]
public void ReplaceEmbeddedPayload(string id, Stream stream, long? maxBytes = null) #Replaces an embedded payload from a readable stream.
Parameters
- id string
- stream System.IO.Stream
- maxBytes long? = null
public ExcelDocument ResetWorkbookTheme(string? name = null) #Replaces the workbook theme with the shared default theme.
Parameters
- name string? = null
Returns
ExcelDocumentpublic string? ResolveThemeColorArgb(uint themeIndex, double? tint = null) #Resolves a SpreadsheetML theme color to an ARGB hexadecimal value.
Parameters
- themeIndex uint
- Zero-based SpreadsheetML theme index: light 1, dark 1, light 2, dark 2, followed by accent colors 1 through 6.
- tint double? = null
- Optional SpreadsheetML tint between -1 and 1.
Returns
string? An eight-character ARGB value, or null when the theme color cannot be resolved.public ExcelWorkbookDiagnosticReport RunWorkbookDoctor(ExcelWorkbookDoctorOptions? options = null) #Runs workbook diagnostics and optional safe repairs for common automation hazards.
Parameters
- options OfficeIMO.Excel.ExcelWorkbookDoctorOptions? = null
public void Save(string filePath) #Saves the document without opening it.
Parameters
- filePath string
- Path to save to.
public void Save(string filePath, ExcelSaveOptions? options) #Saves the document with typed options and no positional Boolean.
Parameters
- filePath string
- Path to save to.
- options OfficeIMO.Excel.ExcelSaveOptions?
- Optional save policy settings.
public void Save(ExcelSaveOptions? options) #Saves to the associated destination with optional save settings.
Parameters
- options OfficeIMO.Excel.ExcelSaveOptions?
public void Save(Stream destination) #Saves the document into a writable stream as XLSX.
Parameters
- destination System.IO.Stream
- Writable stream that receives the Excel package content.
public void Save(Stream destination, ExcelSaveOptions? options) #Saves the document into a writable stream with optional robustness options.
Parameters
- destination System.IO.Stream
- Writable stream that receives the Excel package content.
- options OfficeIMO.Excel.ExcelSaveOptions?
- Optional save behaviors (safe defined-name repair, post-save Open XML validation).
public OfficeConversionReport SaveAsImages(string folderPath, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Saves the selected worksheet images without retaining their encoded payloads, and returns an aggregate report.
Parameters
- folderPath string
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeConversionReportpublic async Task<OfficeConversionReport> SaveAsImagesAsync(string folderPath, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously saves the selected worksheet images without retaining payloads, and returns an aggregate report.
Parameters
- folderPath string
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<OfficeConversionReport>public Task SaveAsync(Stream destination, CancellationToken cancellationToken = default) #Asynchronously saves the document into a writable stream.
Parameters
- destination System.IO.Stream
- Writable stream that receives the Excel package content.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the asynchronous save work.
Returns
Taskpublic Task SaveAsync(Stream destination, ExcelSaveOptions? options, CancellationToken cancellationToken = default) #Asynchronously saves the document into a writable stream with optional robustness options.
Parameters
- destination System.IO.Stream
- Writable stream that receives the Excel package content.
- options OfficeIMO.Excel.ExcelSaveOptions?
- Optional save behaviors (safe defined-name repair, post-save Open XML validation).
- cancellationToken System.Threading.CancellationToken = default
- Cancels the asynchronous save work.
Returns
Taskpublic Task SaveAsync(CancellationToken cancellationToken = default) #Asynchronously saves the document.
Parameters
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token.
Returns
Taskpublic Task SaveAsync(ExcelSaveOptions? options, CancellationToken cancellationToken = default) #Asynchronously saves to the associated destination with optional save settings.
Parameters
- options OfficeIMO.Excel.ExcelSaveOptions?
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic Task SaveAsync(string filePath, ExcelSaveOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously saves to a path with optional save settings.
Parameters
- filePath string
- options OfficeIMO.Excel.ExcelSaveOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic void SaveCopy(string filePath, ExcelSaveOptions? options = null) #Saves an independent copy without changing this workbook's associated destination.
Parameters
- filePath string
- Destination XLSX, XLSM, XLTX, XLTM, XLAM, XLS, or XLSB path.
- options OfficeIMO.Excel.ExcelSaveOptions? = null
- Optional save policy settings.
public async Task SaveCopyAsync(string filePath, ExcelSaveOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously saves an independent copy without changing this workbook's associated destination.
Parameters
- filePath string
- options OfficeIMO.Excel.ExcelSaveOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic void SaveEmbeddedPayload(string id, string filePath, long? maxBytes = null) #Saves an embedded payload by its package-local id.
Parameters
- id string
- filePath string
- maxBytes long? = null
public void SaveMacros(string filePath, long? maxBytes = null) #Saves the VBA project when one is present.
Parameters
- filePath string
- maxBytes long? = null
public IReadOnlyList<ExcelFormulaCellInfo> SearchFormulas(ExcelFormulaSearchOptions options) #Searches formula text, function calls, or parsed references across the workbook.
Parameters
- options OfficeIMO.Excel.ExcelFormulaSearchOptions
Returns
IReadOnlyList<ExcelFormulaCellInfo>public void SetActiveWorksheet(string sheetName) #Sets the worksheet that spreadsheet applications should show when the workbook opens.
Parameters
- sheetName string
- Worksheet name.
public void SetActiveWorksheet(int sheetIndex) #Sets the worksheet that spreadsheet applications should show when the workbook opens.
Parameters
- sheetIndex int
- Zero-based worksheet index.
public void SetActiveWorksheet(ExcelSheet sheet) #Sets the worksheet that spreadsheet applications should show when the workbook opens.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- Worksheet to activate.
public void SetCustomDocumentProperty(string name, ExcelCustomProperty property) #Sets or replaces a custom workbook property.
Parameters
- name string
- property OfficeIMO.Excel.ExcelCustomProperty
public void SetCustomDocumentProperty(string name, object? value) #Sets or replaces a custom workbook property, inferring the custom property type from the value.
Parameters
- name string
- value object?
public void SetNamedFormula(string name, string formula, ExcelSheet? scope = null, bool save = true, bool hidden = false, ExcelDefinedNameValidationMode validationMode = Sanitize) #Creates or replaces a workbook or worksheet-scoped formula definition.
Parameters
- name string
- The defined name used by worksheet formulas.
- formula string
- An Excel expression, with or without a leading equals sign.
- scope OfficeIMO.Excel.ExcelSheet? = null
- The worksheet scope, or null for a workbook name.
- save bool = true
- Whether to persist the workbook change immediately.
- hidden bool = false
- Whether Excel hides the name from its normal name list.
- validationMode OfficeIMO.Excel.ExcelDefinedNameValidationMode = Sanitize
- How the defined name is validated or sanitized.
public void SetNamedRange(string name, string range, ExcelSheet? scope = null, bool save = true, bool hidden = false, ExcelDefinedNameValidationMode validationMode = Sanitize) #Creates or updates a defined name pointing to an A1 range. When scope is provided, the name is local to that sheet; otherwise it is workbook‑global.
Parameters
- name string
- Defined name to create or update.
- range string
- A1 range (e.g. "A1:B10"). Can include a sheet prefix.
- scope OfficeIMO.Excel.ExcelSheet? = null
- Optional sheet scope for a local name.
- save bool = true
- When true, saves the workbook after the change.
- hidden bool = false
- When true, marks the defined name as hidden.
- validationMode OfficeIMO.Excel.ExcelDefinedNameValidationMode = Sanitize
- Controls how the name and range are validated: Sanitize (default) clamps/adjusts; Strict throws on invalid input.
public ExcelRefreshOnOpenResult SetRefreshOnOpen(bool enabled = true, bool pivotTables = true, bool connections = true, bool? savePivotSourceData = null) #Enables or disables workbook refresh-on-open metadata for supported workbook data features. OfficeIMO writes the metadata request; Excel-compatible applications perform the actual refresh on open.
Parameters
- enabled bool = true
- Whether refresh-on-open should be enabled.
- pivotTables bool = true
- Update pivot cache definitions.
- connections bool = true
- Update workbook connection metadata parts.
- savePivotSourceData bool? = null
- Optional pivot cache source-data setting to apply together with the refresh request.
public void SetVbaProject(OfficeVbaProject project, OfficeVbaWriteOptions? options = null) #Applies a native source project, preserving unrelated payloads and requiring explicit VBA signature removal.
Parameters
- project OfficeIMO.OfficeVbaProject
- options OfficeIMO.OfficeVbaWriteOptions? = null
public ExcelDocument SetWorkbookThemeName(string name) #Sets the workbook theme name while preserving the rest of the theme XML.
Parameters
- name string
Returns
ExcelDocumentpublic ExcelDocument SetWorkbookThemeXml(string themeXml) #Replaces or creates the workbook theme part with caller-supplied DrawingML theme XML.
Parameters
- themeXml string
Returns
ExcelDocumentpublic void SetWriteReservation(ExcelWorkbookWriteReservationOptions? options = null) #Writes workbook write-reservation metadata. This is not package encryption and does not protect worksheet or workbook structure.
Parameters
- options OfficeIMO.Excel.ExcelWorkbookWriteReservationOptions? = null
public static OfficePackageSigningResult SignPackageSignature(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficePackageSigningOptions? options = null) #Creates and validates an OPC signature in a saved XLSX/XLSM package.
Parameters
- filePath string
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficePackageSigningOptions? = null
Returns
OfficePackageSigningResultpublic static OfficeVbaSigningResult SignVbaProject(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficeVbaSigningOptions? options = null, IEnumerable<X509Certificate2>? certificateChain = null) #Creates and atomically validates legacy, agile, and V3 VBA signatures.
Parameters
- filePath string
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficeVbaSigningOptions? = null
- certificateChain System.Collections.Generic.IEnumerable<System.Security.Cryptography.X509Certificates.X509Certificate2>? = null
Returns
OfficeVbaSigningResultpublic byte[] ToBytes(ExcelSaveOptions? options = null) #Encodes the workbook using one native-output options bag.
Parameters
- options OfficeIMO.Excel.ExcelSaveOptions? = null
Returns
byte[]public IReadOnlyList<OfficeImageExportResult> ToImages(ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Renders a batch using the encoding and selection in the options.
Parameters
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IReadOnlyList<OfficeImageExportResult>public IReadOnlyList<OfficeImageExportResult> ToImages(OfficeImageExportFormat format, ExcelImageExportOptions? options = null) #Exports workbook sheets as supported raster formats or SVG images.
Parameters
- format OfficeIMO.Drawing.OfficeImageExportFormat
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
Returns
IReadOnlyList<OfficeImageExportResult>public void ToImages(OfficeImageExportFormat format, OfficeImageExportConsumer consumer, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Streams workbook images to a consumer without retaining earlier payloads.
Parameters
- format OfficeIMO.Drawing.OfficeImageExportFormat
- consumer OfficeIMO.Drawing.OfficeImageExportConsumer
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
public Task<IReadOnlyList<OfficeImageExportResult>> ToImagesAsync(ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Renders a batch asynchronously using the same options and evidence contract.
Parameters
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<IReadOnlyList<OfficeImageExportResult>>public bool TryGetCompatibilitySourcePayload(out OfficeCompatibilitySourcePayload? payload, out string? error) #Tries to read an original source retained by a compatibility conversion.
Parameters
- payload OfficeIMO.OfficeCompatibilitySourcePayload?
- error string?
Returns
boolpublic bool TryGetSheet(string name, out ExcelSheet? sheet) #Tries to get a worksheet by name.
Parameters
- name string
- sheet OfficeIMO.Excel.ExcelSheet?
Returns
boolpublic static OfficePackageSigningResult TrySignPackageSignature(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficePackageSigningOptions? options = null) #Attempts OPC signature creation without throwing for an ordinary signing failure.
Parameters
- filePath string
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficePackageSigningOptions? = null
Returns
OfficePackageSigningResultpublic static OfficeVbaSigningResult TrySignVbaProject(string filePath, IOfficeSecurityProvider securityProvider, X509Certificate2 signingCertificate, OfficeVbaSigningOptions? options = null, IEnumerable<X509Certificate2>? certificateChain = null) #Attempts atomic VBA signing and returns structured failure evidence.
Parameters
- filePath string
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- signingCertificate System.Security.Cryptography.X509Certificates.X509Certificate2
- options OfficeIMO.Security.OfficeVbaSigningOptions? = null
- certificateChain System.Collections.Generic.IEnumerable<System.Security.Cryptography.X509Certificates.X509Certificate2>? = null
Returns
OfficeVbaSigningResultpublic void UnprotectWorkbook(bool structure = true, bool windows = true) #Removes the selected workbook structure/window restrictions. With both selected (the default), removes all workbook protection metadata. A subset preserves other restrictions and password hashes.
Parameters
- structure bool = true
- Whether to remove the workbook structure restriction.
- windows bool = true
- Whether to remove the workbook window restriction.
public List<OfficeOpenXmlValidationError> ValidateDocument(OfficeOpenXmlFileFormatVersion fileFormatVersion = Microsoft365) #Validates the document using the specified file format version.
Parameters
- fileFormatVersion OfficeIMO.OfficeOpenXmlFileFormatVersion = Microsoft365
- File format version to validate against.
Returns
List<OfficeOpenXmlValidationError> List of validation errors.public IReadOnlyList<string> ValidateOpenXml() #Validates the current spreadsheet with Open XML validator and returns error messages (if any). Useful for troubleshooting "Repaired Records" issues in Excel.
Returns
IReadOnlyList<string>public static OfficePackageSignatureValidationReport ValidatePackageSignatures(string filePath, IOfficeSecurityProvider securityProvider, OfficePackageSignatureValidationOptions? options = null) #Validates a saved XLSX/XLSM package through an explicitly supplied security provider.
Parameters
- filePath string
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- options OfficeIMO.Security.OfficePackageSignatureValidationOptions? = null
Returns
OfficePackageSignatureValidationReportpublic static OfficePackageSignatureValidationReport ValidatePackageSignatures(Stream source, IOfficeSecurityProvider securityProvider, OfficePackageSignatureValidationOptions? options = null) #Validates an encoded XLSX/XLSM package from a caller-owned stream.
Parameters
- source System.IO.Stream
- A readable stream containing the original package bytes.
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- The provider used for cryptographic and certificate validation.
- options OfficeIMO.Security.OfficePackageSignatureValidationOptions? = null
- Signature validation policy and resource limits, or null for defaults.
Returns
OfficePackageSignatureValidationReport The package signature validation results.public ExcelTemplateBindingReport ValidateTemplateBindings(IDictionary<string, object?> values) #Validates all workbook template markers against a dictionary of values before applying the template.
Parameters
- values System.Collections.Generic.IDictionary<string, object?>
Returns
ExcelTemplateBindingReportpublic ExcelTemplateBindingReport ValidateTemplateBindings(object model) #Validates all workbook template markers against an object model before applying the template.
Parameters
- model object
Returns
ExcelTemplateBindingReportpublic static OfficeVbaSignatureValidationResult ValidateVbaSignatures(string filePath, IOfficeSecurityProvider securityProvider, OfficeVbaSignatureInspectionOptions? options = null) #Validates VBA CMS, trust, timestamp, and Office SIP content binding.
Parameters
- filePath string
- securityProvider OfficeIMO.Security.IOfficeSecurityProvider
- options OfficeIMO.Security.OfficeVbaSignatureInspectionOptions? = null
Returns
OfficeVbaSignatureValidationResultInherited Methods
Properties
public int ActiveWorksheetIndex { get; } #Gets the zero-based index of the worksheet that spreadsheet applications show when the workbook opens.
public ExcelSheet? ActiveWorksheet { get; } #Gets the worksheet that spreadsheet applications show when the workbook opens, or null when the active tab is not a worksheet.
public ExcelCalculationOptions Calculation { get; } #Formula calculation and cached-result policy used during save.
public bool IsWorkbookProtected { get; } #Returns true when workbook-level structure or window protection is present.
public bool SheetCachingEnabled { get; set; } #Enables caching of ExcelSheet wrappers for faster repeat access at the cost of higher memory usage. Set to false to avoid holding references to every sheet in very large workbooks.
public IEqualityComparer<string> TableNameComparer { get; set; } #Controls how workbook-level table name uniqueness is compared. Defaults to StringComparer.OrdinalIgnoreCase. Changing this will reset the internal cache and rebuild it on next use. Set it once before adding tables for predictable behavior.
public ExcelChartStylePreset? DefaultChartStylePreset { get; set; } #Optional default chart style preset applied to charts created in this workbook.
public ExcelExecutionPolicy Execution { get; } #Execution policy for controlling parallel vs sequential operations.
public Func<DateTimeOffset, DateTime> DateTimeOffsetWriteStrategy { get; set; } #Controls how DateTimeOffset values are converted to DateTime before being written to worksheet cells. Defaults to DateTimeOffset.LocalDateTime.
public IReadOnlyList<ExcelSheet> Sheets { get; } #Gets a list of worksheets contained in the document.
public SpreadsheetDocument OpenXmlDocument { get; } #Gets the underlying Open XML package for advanced integration scenarios.
public ExcelDateSystem DateSystem { get; set; } #Gets or sets the workbook date system used for serialized date values.
public string? FilePath { get; internal set; } #Path to the file backing this document.
public ExcelBuiltinDocumentProperties Properties { get; internal set; } #Built-in (core) document properties (Title, Creator, etc.).
public ExcelApplicationProperties ApplicationProperties { get; internal set; } #Extended (application) properties (Company, Manager, etc.).
public ExcelCustomDocumentPropertyCollection CustomProperties { get; } #Custom workbook properties keyed by property name.
public FileAccess FileOpenAccess { get; } #FileOpenAccess of the document
public DocumentAccessMode AccessMode { get; } #Gets whether the workbook was loaded for reading or editing.
public DocumentPersistenceMode PersistenceMode { get; } #Gets the persistence policy selected when the workbook was created or loaded.
public bool DocumentIsValid { get; } #Indicates whether the document is valid.
public List<OfficeOpenXmlValidationError> DocumentValidationErrors { get; } #Gets the list of validation errors for the document.
public bool UsesFileBackedPackage { get; } #True when the editable Open XML package is staged in a bounded temporary file instead of a byte array.
public ExcelSheet this[string sheetName] { get; } #Gets a worksheet by name (case-insensitive).
Parameters
- sheetName string
public ExcelSheet this[int sheetIndex] { get; } #Gets a worksheet by 0-based index in workbook order.
Parameters
- sheetIndex int
public OfficePackageSecurityReport? SourcePackageSecurityReport { get; private set; } #Structural observations captured from the exact loader source bytes when requested; subsequent edits do not change this source report.
public string? SourcePackageSecurityScope { get; private set; } #Identifies the physical source scope of captured package observations.
public ExcelFileFormat SourceFormat { get; private set; } #Gets the detected physical format of the workbook source.
public OfficeFormatDescriptor SourceFormatDescriptor { get; } #Gets the concrete source format, including modern template, add-in, macro, and XLSB variants.
public string? SourcePath { get; } #Gets the original legacy source path, or the current Open XML file association.
public IReadOnlyList<XlsbImportDiagnostic> XlsbImportDiagnostics { get; } #Gets diagnostics produced while importing an XLSB source.
public IReadOnlyList<XlsbPreservedRecordInfo> XlsbPreservedRecords { get; } #Gets BIFF12 records retained from the XLSB source but not projected into the normal workbook model.
public IReadOnlyList<LegacyXlsImportDiagnostic> LegacyXlsImportDiagnostics { get; } #Gets diagnostics produced while importing a legacy binary XLS source through normal loading.
public IReadOnlyList<LegacyXlsUnsupportedFeature> LegacyXlsUnsupportedFeatures { get; } #Gets unsupported or preserve-only legacy XLS features discovered during normal loading.
public IReadOnlyList<LegacyXlsPreservedFeatureRecord> LegacyXlsPreservedFeatures { get; } #Gets preserve-only BIFF feature records that were not projected into the normal workbook model.
public IReadOnlyList<LegacyXlsUnsupportedSheet> LegacyXlsUnsupportedSheets { get; } #Gets legacy XLS sheet entries that were discovered but not projected as normal worksheets.
public IReadOnlyList<LegacyXlsChartSheet> LegacyXlsChartSheets { get; } #Gets legacy XLS chart sheets decoded during import and projected as chart-sheet package parts.
public IReadOnlyList<LegacyXlsCompoundFeatureRecord> LegacyXlsCompoundFeatures { get; } #Gets legacy XLS compound-container features decoded during import but not projected into the normal workbook package.
public bool HasMacros { get; } #Indicates whether the workbook contains a VBA project.
Fields
public const int MaximumDefinedNameLength #Maximum length supported by an Excel workbook defined name.
255Extension Methods
public static IEnumerable<T> RowsAsParallel<T>(ExcelDocument document, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects rows in bounded parallel batches, preserving source order.
Type Parameters
- T
Parameters
- document OfficeIMO.Excel.ExcelDocument
- parallelOptions OfficeIMO.Data.ParallelRowMappingOptions? = null
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T>public static IEnumerable<T?> RowsAsParallel<T>(ExcelDocument document, Action<RowMapper<T?>> configure, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects rows in bounded parallel batches, preserving source order.
Type Parameters
- T
Parameters
- document OfficeIMO.Excel.ExcelDocument
- configure System.Action<OfficeIMO.Data.RowMapper<T?>>
- parallelOptions OfficeIMO.Data.ParallelRowMappingOptions? = null
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T?>public static IEnumerable<T?> RowsAsParallel<T>(ExcelDocument document, Func<IDataRecord, T?> factory, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects rows in bounded parallel batches, preserving source order.
Type Parameters
- T
Parameters
- document OfficeIMO.Excel.ExcelDocument
- factory System.Func<System.Data.IDataRecord, T?>
- parallelOptions OfficeIMO.Data.ParallelRowMappingOptions? = null
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T?>public static IEnumerable<T?> RowsAs<T>(ExcelDocument document, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects rows through the shared data-reader mapping contract.
Type Parameters
- T
Parameters
- document OfficeIMO.Excel.ExcelDocument
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T?>public static IEnumerable<T?> RowsAs<T>(ExcelDocument document, Action<RowMapper<T?>> configure, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects rows through the shared data-reader mapping contract.
Type Parameters
- T
Parameters
- document OfficeIMO.Excel.ExcelDocument
- configure System.Action<OfficeIMO.Data.RowMapper<T?>>
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T?>public static IEnumerable<T?> RowsAs<T>(ExcelDocument document, Func<IDataRecord, T?> factory, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects rows through the shared data-reader mapping contract.
Type Parameters
- T
Parameters
- document OfficeIMO.Excel.ExcelDocument
- factory System.Func<System.Data.IDataRecord, T?>
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T?>