ExcelSheet
OfficeIMO.Excel
Represents a single worksheet within an ExcelDocument.
Inheritance
- object
- ExcelSheet
Usage
Explore 64 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 20
- Property ExcelAutoFilter.Sheet
- Property ExcelCell.Sheet
- Property ExcelCustomFormulaFunctionContext.Worksheet
- Method ExcelDocument.AddBackLinksToToc
- Method ExcelDocument.AddSheet
- Method ExcelDocument.AddTableOfContents
- Method ExcelDocument.CopyWorksheet
- Method ExcelDocument.CopyWorksheetFrom
- Method ExcelDocument.GetSheet
- Property ExcelDocument.ActiveWorksheet
- Property ExcelDocument.Item
- Property ExcelDocument.Sheets
- Property ExcelPageBreak.Sheet
- Property ExcelPivotTable.Sheet
- Property ExcelRange.Sheet
- Property ExcelReportBuilder.Sheet
- Property ExcelSparklineGroup.Sheet
- Property ExcelTable.Sheet
- Method OfficeSheetSelector.ResolveMany
- Property OfficeSheetSelector.Sheet
Accepted by parameters 44
- Method ExcelColumnWidth.ToCharacters
- Method ExcelColumnWidth.ToLength
- Method ExcelDocument.AddWorksheetMetadataPart
- Method ExcelDocument.CompareRanges
- Method ExcelDocument.CompareRanges
- Method ExcelDocument.CompareWorksheets
- Method ExcelDocument.CompareWorksheets
- Method ExcelDocument.CopyWorksheet
- Method ExcelDocument.GetAllNamedRanges
- Method ExcelDocument.GetNamedRange
- Method ExcelDocument.MergeWorksheets
- Method ExcelDocument.MergeWorksheets
- Method ExcelDocument.RemoveNamedRange
- Method ExcelDocument.RenameNamedRange
- Method ExcelDocument.ReorderWorksheet
- Method ExcelDocument.SetActiveWorksheet
- Method ExcelDocument.SetNamedFormula
- Method ExcelDocument.SetNamedRange
- Method ExcelDocument.TryGetSheet
- Extension method ExcelSheet.AddContributionChart
- Extension method ExcelSheet.AddDashboard
- Extension method ExcelSheet.AddDashboardChart
- Extension method ExcelSheet.AddKpiScorecardChart
- Extension method ExcelSheet.AddRevenueTrendChart
- Extension method ExcelSheet.AddStatusBreakdownChart
- Extension method ExcelSheet.AddSubtotalSummary
- Extension method ExcelSheet.AddTopNBarChart
- Extension method ExcelSheet.AddVarianceColumnChart
- Extension method ExcelSheet.AddVarianceWaterfallChart
- Method ExcelSheet.AddPivotTable
- Method ExcelSheet.Batch
- Method ExcelSheet.SetInternalLink
- Method ExcelSheet.UpdatePivotTableSource
- Method OfficeSheetSelector.ResolveMany
- Method ExcelReportExtensions.AddContributionChart
- Method ExcelReportExtensions.AddDashboard
- Method ExcelReportExtensions.AddDashboardChart
- Method ExcelReportExtensions.AddKpiScorecardChart
- Method ExcelReportExtensions.AddRevenueTrendChart
- Method ExcelReportExtensions.AddStatusBreakdownChart
- Method ExcelReportExtensions.AddSubtotalSummary
- Method ExcelReportExtensions.AddTopNBarChart
- Method ExcelReportExtensions.AddVarianceColumnChart
- Method ExcelReportExtensions.AddVarianceWaterfallChart
Methods
public ExcelChart AddBubbleChartFromRanges(IEnumerable<ExcelChartSeriesRange> seriesRanges, int row, int column, OfficeLength? width = null, OfficeLength? height = null, string? title = null) #Adds a bubble chart using explicit X/Y/size ranges.
Parameters
- seriesRanges System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelChartSeriesRange>
- row int
- column int
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- title string? = null
Returns
ExcelChartpublic ExcelChart AddChart(OfficeChartType type, ExcelChartData data, OfficeChartOptions? options = null) #Adds an editable native chart with per-series chart kinds, axes, styles and optional explicit X values.
Parameters
- type OfficeIMO.OfficeChartType
- data OfficeIMO.Excel.ExcelChartData
- options OfficeIMO.OfficeChartOptions? = null
Returns
ExcelChartpublic ExcelChart AddChart(OfficeChartType type, ExcelChartDataRange data, OfficeChartOptions? options = null) #Adds an editable chart linked to a worksheet range, including horizontal ranges and ranges on other sheets.
Parameters
- type OfficeIMO.OfficeChartType
- data OfficeIMO.Excel.ExcelChartDataRange
- options OfficeIMO.OfficeChartOptions? = null
Returns
ExcelChartpublic ExcelChart AddChart(OfficeChartType type, string rangeOrTable, OfficeChartOptions? options = null) #Adds an editable chart linked to an A1 range or a native table on this worksheet.
Parameters
- type OfficeIMO.OfficeChartType
- rangeOrTable string
- options OfficeIMO.OfficeChartOptions? = null
Returns
ExcelChartpublic ExcelChart AddChart(OfficeChartType chartKind, OfficeChartData data) #Adds an editable native chart with the format's default title, size and placement.
Parameters
- chartKind OfficeIMO.OfficeChartType
- data OfficeIMO.Drawing.OfficeChartData
Returns
ExcelChartpublic ExcelChart AddChart(OfficeChartType chartKind, OfficeChartData data, OfficeChartOptions? options) #Adds a native Excel chart from the shared OfficeIMO chart contract, including per-series combo kinds and primary or secondary axis assignments.
Parameters
- chartKind OfficeIMO.OfficeChartType
- data OfficeIMO.Drawing.OfficeChartData
- options OfficeIMO.OfficeChartOptions?
Returns
ExcelChartpublic ExcelChart AddChartFromRanges(OfficeChartType type, IEnumerable<ExcelChartSeriesRange> series, OfficeChartOptions? options = null) #Adds an editable chart of any type whose series reference their own worksheet ranges, which need not be adjacent.
Parameters
- type OfficeIMO.OfficeChartType
- series System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelChartSeriesRange>
- options OfficeIMO.OfficeChartOptions? = null
Returns
ExcelChartpublic ExcelChart AddChart<T>(OfficeChartType type, IEnumerable<T?> data, string category, params string[] series) #Adds an editable native chart using property names, including names supplied with nameof.
Type Parameters
- T
Parameters
- type OfficeIMO.OfficeChartType
- data System.Collections.Generic.IEnumerable<T?>
- category string
- series string[]
Returns
ExcelChartpublic ExcelChart AddChart<T>(OfficeChartType type, IEnumerable<T?> data, string category, OfficeChartOptions? options, params string[] series) #Adds an editable native chart using property names and shared or format-specific options.
Type Parameters
- T
Parameters
- type OfficeIMO.OfficeChartType
- data System.Collections.Generic.IEnumerable<T?>
- category string
- options OfficeIMO.OfficeChartOptions?
- series string[]
Returns
ExcelChartpublic ExcelChart AddChart<T, TCategory>(OfficeChartType type, IEnumerable<T?> data, Func<T?, TCategory?> category, params OfficeSeries[] series) #Adds an editable native chart from typed category data and numeric series.
Type Parameters
- T
- TCategory
Parameters
- type OfficeIMO.OfficeChartType
- data System.Collections.Generic.IEnumerable<T?>
- category System.Func<T?, TCategory?>
- series OfficeIMO.OfficeSeries[]
Returns
ExcelChartpublic ExcelChart AddChart<T, TCategory>(OfficeChartType type, IEnumerable<T?> data, Func<T?, TCategory?> category, OfficeChartOptions? options, params OfficeSeries[] series) #Adds an editable native chart from typed data with a title, size and optional format-specific placement.
Type Parameters
- T
- TCategory
Parameters
- type OfficeIMO.OfficeChartType
- data System.Collections.Generic.IEnumerable<T?>
- category System.Func<T?, TCategory?>
- options OfficeIMO.OfficeChartOptions?
- series OfficeIMO.OfficeSeries[]
Returns
ExcelChartpublic ExcelConditionalFormattingInfo AddConditionalFormattingRule(ExcelConditionalFormattingInfo definition) #Adds a rule from the format-neutral conditional-formatting model.
Parameters
- definition OfficeIMO.Excel.ExcelConditionalFormattingInfo
public ExcelChart AddFunnelChart(IEnumerable<string> categories, IEnumerable<double> values, int row, int column, string title = "Funnel", bool sortDescending = true, OfficeLength? width = null, OfficeLength? height = null) #Adds a centered funnel-compatible stacked bar chart from category values.
Parameters
- categories System.Collections.Generic.IEnumerable<string>
- values System.Collections.Generic.IEnumerable<double>
- row int
- column int
- title string = "Funnel"
- sortDescending bool = true
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
Returns
ExcelChartpublic ExcelChart AddHistogramChart(IEnumerable<double> values, int row, int column, string title = "Histogram", int? binCount = null, double? binWidth = null, OfficeLength? width = null, OfficeLength? height = null) #Adds a histogram-compatible column chart after calculating bins from raw numeric observations.
Parameters
- values System.Collections.Generic.IEnumerable<double>
- row int
- column int
- title string = "Histogram"
- binCount int? = null
- binWidth double? = null
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
Returns
ExcelChartpublic ExcelIgnoredErrorRegionInfo AddIgnoredErrorRegion(IEnumerable<string> ranges, ExcelIgnoredErrorKind errors) #Adds ignored-error metadata for one or more regions.
Parameters
- ranges System.Collections.Generic.IEnumerable<string>
- errors OfficeIMO.Excel.ExcelIgnoredErrorKind
Returns
ExcelIgnoredErrorRegionInfopublic ExcelImage AddImage(int row, int column, byte[] imageBytes, ExcelImageOptions? options = null) #Embeds native image bytes at a one-based cell and returns the attached image.
Parameters
- row int
- column int
- imageBytes byte[]
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(int row, int column, string path, ExcelImageOptions? options = null) #Loads an image from a file at a one-based cell and returns the attached image.
Parameters
- row int
- column int
- path string
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(int row, int column, Stream stream, ExcelImageOptions? options = null) #Loads an image from a stream at a one-based cell and returns the attached image.
Parameters
- row int
- column int
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(string cellOrRange, byte[] imageBytes, ExcelImageOptions? options = null) #Embeds native image bytes at an A1 cell or two-cell range and returns the attached image.
Parameters
- cellOrRange string
- imageBytes byte[]
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(string cellOrRange, string path, ExcelImageOptions? options = null) #Loads an image from a file at an A1 cell or two-cell range and returns the attached image.
Parameters
- cellOrRange string
- path string
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(string cellOrRange, Stream stream, ExcelImageOptions? options = null) #Loads an image from a stream at an A1 cell or two-cell range and returns the attached image.
Parameters
- cellOrRange string
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(OfficeLength x, OfficeLength y, byte[] imageBytes, ExcelImageOptions? options = null) #Embeds native image bytes at a non-negative absolute position and returns the attached image.
Parameters
- x OfficeIMO.OfficeLength
- y OfficeIMO.OfficeLength
- imageBytes byte[]
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(OfficeLength x, OfficeLength y, string path, ExcelImageOptions? options = null) #Loads an image from a file at a non-negative absolute position and returns the attached image.
Parameters
- x OfficeIMO.OfficeLength
- y OfficeIMO.OfficeLength
- path string
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic ExcelImage AddImage(OfficeLength x, OfficeLength y, Stream stream, ExcelImageOptions? options = null) #Loads an image from a stream at a non-negative absolute position and returns the attached image.
Parameters
- x OfficeIMO.OfficeLength
- y OfficeIMO.OfficeLength
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageOptions? = null
Returns
ExcelImagepublic async Task<ExcelImage> AddImageAsync(int row, int column, string path, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at a one-based cell and returns the attached image. Only source I/O is asynchronous.
Parameters
- row int
- column int
- path string
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(int row, int column, Stream stream, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at a one-based cell and returns the attached image. Only source I/O is asynchronous.
Parameters
- row int
- column int
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(int row, int column, Uri uri, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at a one-based cell and returns the attached image. Only source I/O is asynchronous.
Parameters
- row int
- column int
- uri System.Uri
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(string cellOrRange, string path, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at an A1 cell or two-cell range and returns the attached image. Only source I/O is asynchronous.
Parameters
- cellOrRange string
- path string
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(string cellOrRange, Stream stream, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at an A1 cell or two-cell range and returns the attached image. Only source I/O is asynchronous.
Parameters
- cellOrRange string
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(string cellOrRange, Uri uri, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at an A1 cell or two-cell range and returns the attached image. Only source I/O is asynchronous.
Parameters
- cellOrRange string
- uri System.Uri
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(OfficeLength x, OfficeLength y, string path, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at a non-negative absolute position and returns the attached image. Only source I/O is asynchronous.
Parameters
- x OfficeIMO.OfficeLength
- y OfficeIMO.OfficeLength
- path string
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(OfficeLength x, OfficeLength y, Stream stream, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at a non-negative absolute position and returns the attached image. Only source I/O is asynchronous.
Parameters
- x OfficeIMO.OfficeLength
- y OfficeIMO.OfficeLength
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public async Task<ExcelImage> AddImageAsync(OfficeLength x, OfficeLength y, Uri uri, ExcelImageOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously loads an image at a non-negative absolute position and returns the attached image. Only source I/O is asynchronous.
Parameters
- x OfficeIMO.OfficeLength
- y OfficeIMO.OfficeLength
- uri System.Uri
- options OfficeIMO.Excel.ExcelImageOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<ExcelImage>public ExcelPageBreak AddManualColumnPageBreak(int column, bool save = true) #Adds a manual worksheet column page break after the specified one-based column.
Parameters
- column int
- save bool = true
Returns
ExcelPageBreakpublic ExcelPageBreak AddManualRowPageBreak(int row, bool save = true) #Adds a manual worksheet row page break after the specified one-based row.
Parameters
- row int
- save bool = true
Returns
ExcelPageBreakpublic ExcelModernChart AddModernChart(ExcelChartData data, int row, int column, ExcelModernChartType chartType, string? title = null, OfficeLength? width = null, OfficeLength? height = null) #Adds a native ChartEx chart backed by OfficeIMO's shared hidden chart-data owner.
Parameters
- data OfficeIMO.Excel.ExcelChartData
- row int
- column int
- chartType OfficeIMO.Excel.ExcelModernChartType
- title string? = null
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
Returns
ExcelModernChartpublic ExcelChart AddParetoChart(IEnumerable<string> categories, IEnumerable<double> values, int row, int column, string title = "Pareto", OfficeLength? width = null, OfficeLength? height = null) #Adds a Pareto-compatible column and cumulative-percentage line chart.
Parameters
- categories System.Collections.Generic.IEnumerable<string>
- values System.Collections.Generic.IEnumerable<double>
- row int
- column int
- title string = "Pareto"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
Returns
ExcelChartpublic ExcelChart AddPivotChartFromRange(string pivotTableName, string dataRangeA1, int row, int column, OfficeLength? width = null, OfficeLength? height = null, OfficeChartType type = Column, bool hasHeaders = true, string? title = null, bool includeCachedData = true, uint formatId = 0) #Adds a chart using an A1 range and marks it as sourced from an existing pivot table.
Parameters
- pivotTableName string
- dataRangeA1 string
- row int
- column int
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- type OfficeIMO.OfficeChartType = Column
- hasHeaders bool = true
- title string? = null
- includeCachedData bool = true
- formatId uint = 0
Returns
ExcelChartpublic ExcelPivotGroupingInfo AddPivotManualGrouping(string pivotTableName, string sourceFieldName, string groupFieldName, IReadOnlyDictionary<string, string[]> groups, IReadOnlyCollection<string>? hiddenGroupItems = null) #Adds a derived manual text grouping field and hides selected group labels.
Parameters
- pivotTableName string
- sourceFieldName string
- groupFieldName string
- groups System.Collections.Generic.IReadOnlyDictionary<string, string[]>
- hiddenGroupItems System.Collections.Generic.IReadOnlyCollection<string>? = null
Returns
ExcelPivotGroupingInfopublic ExcelPivotTable AddPivotTable(string sourceRange, string destinationCell) #Creates a pivot table from a worksheet range and returns its editable object.
Parameters
- sourceRange string
- destinationCell string
Returns
ExcelPivotTablepublic ExcelPivotTable AddPivotTable(string sourceRange, string destinationCell, ExcelPivotTableOptions? options) #Creates a pivot table from a worksheet range using the supplied authoring options.
Parameters
- sourceRange string
- destinationCell string
- options OfficeIMO.Excel.ExcelPivotTableOptions?
Returns
ExcelPivotTablepublic ExcelPivotTable AddPivotTable(ExcelSheet sourceSheet, string sourceRange, string destinationCell, ExcelPivotTableOptions? options = null) #Creates an editable pivot on this worksheet using source cells from another worksheet in the same workbook.
Parameters
- sourceSheet OfficeIMO.Excel.ExcelSheet
- sourceRange string
- destinationCell string
- options OfficeIMO.Excel.ExcelPivotTableOptions? = null
Returns
ExcelPivotTablepublic ExcelChart AddScatterChartFromRanges(IEnumerable<ExcelChartSeriesRange> seriesRanges, int row, int column, OfficeLength? width = null, OfficeLength? height = null, string? title = null) #Adds a scatter chart using explicit X/Y ranges.
Parameters
- seriesRanges System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelChartSeriesRange>
- row int
- column int
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- title string? = null
Returns
ExcelChartpublic ExcelSparklineGroup AddSparklines(string dataRange, string locationRange, ExcelSparklineType type, bool displayMarkers = false, bool displayHighLow = false, bool displayFirstLast = false, bool displayNegative = false, bool displayAxis = false, OfficeColor? seriesColor = null, OfficeColor? axisColor = null, OfficeColor? negativeColor = null, OfficeColor? markersColor = null, OfficeColor? highColor = null, OfficeColor? lowColor = null, OfficeColor? firstColor = null, OfficeColor? lastColor = null) #Adds sparklines to the worksheet.
Parameters
- dataRange string
- A1 range containing the data (e.g., "B2:M2").
- locationRange string
- A1 range where sparklines will be placed (e.g., "N2:N2").
- type OfficeIMO.Excel.ExcelSparklineType
- Sparkline type.
- displayMarkers bool = false
- Show markers for each data point.
- displayHighLow bool = false
- Show high/low markers.
- displayFirstLast bool = false
- Show first/last markers.
- displayNegative bool = false
- Show negative markers.
- displayAxis bool = false
- Show axis.
- seriesColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- axisColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- negativeColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- markersColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- highColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- lowColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- firstColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- lastColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
Returns
ExcelSparklineGrouppublic ExcelSparklineGroup AddSparklines(string dataRange, string locationRange, bool displayMarkers = false, bool displayHighLow = false, bool displayFirstLast = false, bool displayNegative = false, bool displayAxis = false, OfficeColor? seriesColor = null, OfficeColor? axisColor = null, OfficeColor? negativeColor = null, OfficeColor? markersColor = null, OfficeColor? highColor = null, OfficeColor? lowColor = null, OfficeColor? firstColor = null, OfficeColor? lastColor = null) #Adds line sparklines to the worksheet.
Parameters
- dataRange string
- A1 range containing the data (e.g., "B2:M2").
- locationRange string
- A1 range where sparklines will be placed (e.g., "N2:N2").
- displayMarkers bool = false
- Show markers for each data point.
- displayHighLow bool = false
- Show high/low markers.
- displayFirstLast bool = false
- Show first/last markers.
- displayNegative bool = false
- Show negative markers.
- displayAxis bool = false
- Show axis.
- seriesColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- axisColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- negativeColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- markersColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- highColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- lowColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- firstColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
- lastColor OfficeIMO.OfficeColor? = null
- Optional literal color or theme role.
Returns
ExcelSparklineGrouppublic ExcelTable AddTable(string range, bool hasHeader = true, string? name = null, ExcelTableStyle style = TableStyleMedium2, bool includeAutoFilter = true, ExcelTableNameValidationMode validationMode = Sanitize) #Adds an Excel table to the worksheet over the specified range with optional AutoFilter and name validation behavior.
Parameters
- range string
- Cell range (e.g. "A1:B3") defining the table area.
- hasHeader bool = true
- Indicates whether the first row is a header row.
- name string? = null
- Name of the table. If empty, a default name is used. Examples: "My Table" becomes "My_Table"; "123Report" becomes "_123Report"; spaces and invalid characters are replaced with underscores. If a name already exists in this workbook, a numeric suffix is appended (e.g., "Table", "Table2").
- style OfficeIMO.Excel.ExcelTableStyle = TableStyleMedium2
- Table style to apply.
- includeAutoFilter bool = true
- Whether to include AutoFilter dropdowns in the table headers.
- validationMode OfficeIMO.Excel.ExcelTableNameValidationMode = Sanitize
- Controls how invalid table names are handled: ExcelTableNameValidationMode.Sanitize (default) replaces invalid characters and adjusts the name; ExcelTableNameValidationMode.Strict throws descriptive exceptions for invalid names.
Returns
ExcelTablepublic ExcelTable AddTable(DataTable data, OfficeTableOptions? options = null, int row = 1, int column = 1) #Adds an editable native table from a data table, preserving its typed cell values.
Parameters
- data System.Data.DataTable
- options OfficeIMO.OfficeTableOptions? = null
- row int = 1
- column int = 1
Returns
ExcelTablepublic ExcelTable AddTable<T>(IEnumerable<T?> rows, ValueTuple<string, Func<T?, object?>>[] columns, OfficeTableOptions? options = null, int row = 1, int column = 1) #Adds an attached native table using explicit AOT-safe column selectors and the ordinary table options.
Type Parameters
- T
Parameters
- rows System.Collections.Generic.IEnumerable<T?>
- columns System.ValueTuple<string, System.Func<T?, object?>>[]
- options OfficeIMO.OfficeTableOptions? = null
- row int = 1
- column int = 1
Returns
ExcelTablepublic ExcelTable AddTable<T>(IEnumerable<T?> rows, OfficeTableOptions? options = null, int row = 1, int column = 1) #Adds an editable native table from typed properties, fields, or string-keyed dictionary columns.
Type Parameters
- T
Parameters
- rows System.Collections.Generic.IEnumerable<T?>
- options OfficeIMO.OfficeTableOptions? = null
- row int = 1
- column int = 1
Returns
ExcelTablepublic ExcelThreadedCommentResult AddThreadedComment(ExcelThreadedCommentOptions options) #Adds a threaded comment or threaded reply to the worksheet while maintaining workbook person metadata.
Parameters
- options OfficeIMO.Excel.ExcelThreadedCommentOptions
- Threaded comment options.
Returns
ExcelThreadedCommentResultpublic ExcelThreadedCommentResult AddThreadedComment(string address, string text, string author = "OfficeIMO", string? parentId = null, bool done = false) #Adds a threaded comment or threaded reply to the worksheet.
Parameters
- address string
- text string
- author string = "OfficeIMO"
- parentId string? = null
- done bool = false
Returns
ExcelThreadedCommentResultpublic IReadOnlyList<ExcelThreadedCommentResult> AddThreadedComments(IEnumerable<ExcelThreadedCommentOptions> options) #Adds comments and replies as one prevalidated batch, indexing workbook identities and saving each part once. Replies must refer to an existing root or an earlier root in the batch, on this worksheet and cell.
Parameters
- options System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelThreadedCommentOptions>
- Comment options, captured before package mutation.
public ExcelChart AddWaterfallChart(IEnumerable<string> categories, IEnumerable<double> changes, int row, int column, string title = "Waterfall", bool includeTotal = true, string totalLabel = "Total", OfficeLength? width = null, OfficeLength? height = null) #Adds a waterfall-compatible stacked column chart from signed changes and an optional final total.
Parameters
- categories System.Collections.Generic.IEnumerable<string>
- changes System.Collections.Generic.IEnumerable<double>
- row int
- column int
- title string = "Waterfall"
- includeTotal bool = true
- totalLabel string = "Total"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
Returns
ExcelChartpublic string AppendDataTableToTable(DataTable dataTable, string tableName, bool matchColumnsByHeader = true, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Appends rows from a DataTable to an existing Excel table and expands the table range.
Parameters
- dataTable System.Data.DataTable
- Source DataTable containing rows to append.
- tableName string
- Existing table name or display name.
- matchColumnsByHeader bool = true
- When true, DataTable columns are matched to table columns by header text. When false, columns are appended by position.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Optional execution mode override.
- ct System.Threading.CancellationToken = default
- Cancellation token.
Returns
string The updated A1 range of the table.Exceptions
ArgumentNullException– Thrown when dataTable or tableName is null.ArgumentException– Thrown when the source columns cannot be mapped to the existing table.InvalidOperationException– Thrown when the table cannot be found or cannot be safely expanded.
public IReadOnlyList<ExcelColumnFormatResult> ApplyColumnFormatPlan(ExcelColumnFormatPlan plan, bool includeHeader = false, bool autoFit = false, int? headerRow = null, ExcelReaderOptions? options = null) #Applies reusable header-based column number formats to the worksheet.
Parameters
- plan OfficeIMO.Excel.ExcelColumnFormatPlan
- Column format plan to apply.
- includeHeader bool = false
- True to include header cells in every rule unless a rule already includes them.
- autoFit bool = false
- True to auto-fit every resolved formatted column.
- headerRow int? = null
- Optional one-based row containing the headers used to resolve column names.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Read options used while resolving headers.
public void ApplyNamedStyle(string name, string range, int maximumCells = 1000000, CancellationToken cancellationToken = default) #Applies a workbook named style to a range with cancellation and a hard cell budget.
Parameters
- name string
- range string
- maximumCells int = 1000000
- cancellationToken System.Threading.CancellationToken = default
public int ApplyTemplate(IDictionary<string, object?> values, IFormatProvider? provider = null, bool throwOnMissing = false) #Replaces {{Marker}} placeholders in text cells on this worksheet 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 in text cells on this worksheet 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 in text cells on this worksheet 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 in text cells on this worksheet 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 ApplyTemplateOptionalRows(int firstRow, int rowCount, bool include, IDictionary<string, object?> values, ExcelTemplateOptions? options = null) #Includes or removes an optional worksheet row block. When included, markers in the block are bound with the supplied values. When removed, following worksheet rows are shifted up.
Parameters
- firstRow int
- 1-based first row in the optional block.
- rowCount int
- Number of rows in the optional block.
- include bool
- True to keep and bind the block; false to remove it.
- values System.Collections.Generic.IDictionary<string, object?>
- Values used when the block is included.
- options OfficeIMO.Excel.ExcelTemplateOptions? = null
- Optional template binding options.
Returns
intpublic int ApplyTemplateOptionalRows(int firstRow, int rowCount, bool include, object model, ExcelTemplateOptions? options = null) #Includes or removes an optional worksheet row block. When included, markers in the block are bound from public properties on the supplied model. When removed, following worksheet rows are shifted up.
Parameters
- firstRow int
- 1-based first row in the optional block.
- rowCount int
- Number of rows in the optional block.
- include bool
- True to keep and bind the block; false to remove it.
- model object
- Model used when the block is included.
- options OfficeIMO.Excel.ExcelTemplateOptions? = null
- Optional template binding options.
Returns
intpublic int ApplyTemplateRows(int templateRow, IEnumerable<IDictionary<string, object?>> rows, ExcelTemplateOptions? options = null) #Repeats a single template row for each supplied row value dictionary, inserting additional worksheet rows as needed.
Parameters
- templateRow int
- 1-based row number containing template markers.
- rows System.Collections.Generic.IEnumerable<System.Collections.Generic.IDictionary<string, object?>>
- Row value dictionaries. Each dictionary is bound to one copied row.
- options OfficeIMO.Excel.ExcelTemplateOptions? = null
- Optional template binding options.
Returns
intpublic int ApplyTemplateRows<T>(int templateRow, IEnumerable<T> rows, ExcelTemplateOptions? options = null) #Repeats a single template row for each supplied row model, inserting additional worksheet rows as needed. Public properties are exposed as marker names, including nested dotted names.
Type Parameters
- T
Parameters
- templateRow int
- 1-based row number containing template markers.
- rows System.Collections.Generic.IEnumerable<T>
- Row models. Each model is bound to one copied row.
- options OfficeIMO.Excel.ExcelTemplateOptions? = null
- Optional template binding options.
Returns
intpublic void AutoFitColumn(int columnIndex) #Auto-fits the width of the specified column based on its contents.
Parameters
- columnIndex int
- 1-based column index.
public void AutoFitColumns(ExcelExecutionMode? mode = null, CancellationToken ct = default) #Automatically fits all columns based on their content.
Parameters
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Overrides how the auto-fit work is scheduled across columns.
- ct System.Threading.CancellationToken = default
- Cancels the auto-fit pass while widths are being measured or applied.
public void AutoFitColumnsExcept(IEnumerable<int> columnsToSkip, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Automatically fits all columns except the supplied indexes.
Parameters
- columnsToSkip System.Collections.Generic.IEnumerable<int>
- 1-based column indexes that should not be resized.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Overrides how the auto-fit work is scheduled for the remaining columns.
- ct System.Threading.CancellationToken = default
- Cancels the auto-fit pass before it completes.
public void AutoFitColumnsFor(IEnumerable<int> columnIndexes, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Automatically fits the supplied set of column indexes.
Parameters
- columnIndexes System.Collections.Generic.IEnumerable<int>
- 1-based column indexes that should be resized to fit their content.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Overrides how the auto-fit work is scheduled across the selected columns.
- ct System.Threading.CancellationToken = default
- Cancels the auto-fit pass for the selected columns.
public void AutoFitRow(int rowIndex) #Auto-fits the height of the specified row based on its contents.
Parameters
- rowIndex int
- 1-based row index.
public void AutoFitRows(ExcelExecutionMode? mode = null, CancellationToken ct = default) #Automatically fits all rows based on their content.
Parameters
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Overrides how the auto-fit work is scheduled across rows.
- ct System.Threading.CancellationToken = default
- Cancels the row auto-fit pass while heights are being calculated or applied.
public void Batch(Action<ExcelSheet> action) #Executes multiple worksheet mutations under a single workbook write lock. Cell styling inside the batch (bold, fills, fonts, wrapping, number formats and similar) looks formats up through an index and saves the stylesheet once when the batch ends, so styling cells row by row stays proportional to the cells styled.
Parameters
- action System.Action<OfficeIMO.Excel.ExcelSheet>
- The worksheet updates to execute.
public ExcelCell Cell(int row, int column) #Returns the cell at a 1-based row and column. The handle is a view over the worksheet and stores no cell state, so creating one allocates nothing and does not create the cell until a value or style is written.
Parameters
- row int
- column int
Returns
ExcelCellExceptions
ArgumentOutOfRangeException– The row or column is outside the worksheet.
public ExcelChartGridLayout ChartLayout(int row, int column, OfficeLength? width = null, OfficeLength? height = null, int chartsPerRow = 2, OfficeLength? horizontalGap = null, int verticalGapRows = 2) #Creates a sequential chart layout helper for dashboard-style worksheets that use the default Excel row and column grid.
Parameters
- row int
- One-based worksheet row for the first chart.
- column int
- One-based worksheet column for the first chart.
- width OfficeIMO.OfficeLength? = null
- Default chart physical width.
- height OfficeIMO.OfficeLength? = null
- Default chart physical height.
- chartsPerRow int = 2
- Number of charts to place before wrapping to the next row.
- horizontalGap OfficeIMO.OfficeLength? = null
- Minimum horizontal physical gap between chart slots, calculated against default-width Excel columns.
- verticalGapRows int = 2
- Minimum vertical gap between chart rows, in worksheet rows, calculated against default-height Excel rows.
public void ClearArrayFormula(string a1RangeOrCell) #Clears an array formula whose reference overlaps the supplied range or cell.
Parameters
- a1RangeOrCell string
public void ClearCachedFormulaResults() #Removes cached values from formula cells on this sheet.
public void ClearColumnGroup(int startColumn, int endColumn, bool unhide = true) #Clears Excel outline grouping metadata from a contiguous range of worksheet columns.
Parameters
- startColumn int
- First 1-based column to clear.
- endColumn int
- Last 1-based column to clear.
- unhide bool = true
- Whether hidden columns in the cleared range should be shown.
public void ClearComment(int row, int column) #Removes a comment from the specified cell (if present).
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
public void ClearComment(string a1) #Removes a comment from the specified A1 cell reference (if present).
Parameters
- a1 string
- A1 cell reference (e.g., "B5").
public int ClearComments(ExcelCommentFilter filter) #Removes comments that match the supplied filter.
Parameters
- filter OfficeIMO.Excel.ExcelCommentFilter
- Author, text, and/or A1 range filter used to choose comments.
Returns
int Number of comments removed.public void ClearConditionalFormatting(string? a1Range = null) #Clears conditional formatting rules, optionally restricted to a range.
Parameters
- a1Range string? = null
public void ClearIgnoredErrorRegions() #Clears all standard ignored-error regions.
public bool ClearManualColumnPageBreaks(bool save = true) #Clears all manual worksheet column page breaks.
Parameters
- save bool = true
Returns
boolpublic bool ClearManualPageBreaks(bool save = true) #Clears all manual worksheet row and column page breaks.
Parameters
- save bool = true
Returns
boolpublic bool ClearManualRowPageBreaks(bool save = true) #Clears all manual worksheet row page breaks.
Parameters
- save bool = true
Returns
boolpublic void ClearRowGroup(int startRow, int endRow, bool unhide = true) #Clears Excel outline grouping metadata from a contiguous range of worksheet rows.
Parameters
- startRow int
- First 1-based row to clear.
- endRow int
- Last 1-based row to clear.
- unhide bool = true
- Whether hidden rows in the cleared range should be shown.
public void ClearTableTotals(string tableOrRange) #Clears totals-row settings for the table identified by range, name, or display name.
Parameters
- tableOrRange string
- Table range, name, or display name.
public ExcelConditionalFormattingInfo CloneConditionalFormattingRule(ExcelConditionalFormattingInfo rule, string targetRange, int? priority = null) #Clones a rule, including unrecognized attributes and child markup, to another range.
Parameters
- rule OfficeIMO.Excel.ExcelConditionalFormattingInfo
- targetRange string
- priority int? = null
public ExcelColumnStyleByHeaderBuilder ColumnStyleByHeader(string header, bool includeHeader = false, ExcelReaderOptions? options = null) #Returns a builder for styling a column resolved by header with discoverable methods. When the header cannot be resolved an inert builder is returned so calls become no-ops.
Parameters
- header string
- Header text used to resolve the target column after applying any configured normalization.
- includeHeader bool = false
- True to include the header row when styling; false to begin styling from the first data row.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Read options that control header normalization and other resolution behavior.
public ExcelWorkbookDataReader CreateDataReader(ExcelReaderOptions? options = null) #Creates a forward-only data reader over this worksheet in the current open workbook, including unsaved edits.
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
Returns
ExcelWorkbookDataReaderpublic ExcelRangeVisualInfo CreateVisualSnapshot(ExcelImageExportOptions? options = null) #Creates a format-neutral visual snapshot for a worksheet range or the used range.
Parameters
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
Returns
ExcelRangeVisualInfopublic ExcelNamedStyleInfo DefineNamedStyle(string name, int sourceRow, int sourceColumn, bool hidden = false) #Creates or replaces a workbook named style from a cell's current formatting.
Parameters
- name string
- sourceRow int
- sourceColumn int
- hidden bool = false
Returns
ExcelNamedStyleInfopublic ExcelMutationResult DeleteCells(string range, ExcelCellShiftDirection direction, ExcelMutationPlanOptions? options = null, CancellationToken cancellationToken = default) #Transactionally deletes cells.
Parameters
- range string
- direction OfficeIMO.Excel.ExcelCellShiftDirection
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
ExcelMutationResultpublic void DeleteColumns(int firstColumn, int count = 1) #Deletes worksheet columns starting at firstColumn and shifts following columns left. Formula references to cells fully removed by the operation become #REF!; partially overlapping ranges are reduced to the surviving cells. Use ExcelSheet.DeleteColumnsTransactional for rollback and post-edit diagnostics.
Parameters
- firstColumn int
- count int = 1
Exceptions
ArgumentOutOfRangeException– The requested columns fall outside the worksheet column limit.InvalidOperationException– The deletion would remove every column of a table, or intersect an array formula, data table or PivotTable output range, or the worksheet contains unsupported controls.
public ExcelMutationResult DeleteColumnsTransactional(int firstColumn, int count = 1, ExcelMutationPlanOptions? options = null, CancellationToken cancellationToken = default) #Plans and transactionally deletes columns with bounded rollback and post-edit diagnostics.
Parameters
- firstColumn int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
ExcelMutationResultpublic void DeleteRows(int firstRow, int count = 1) #Deletes worksheet rows starting at firstRow and shifts following rows up. Formula references to cells fully removed by the operation become #REF!; partially overlapping ranges are reduced to the surviving cells.
Parameters
- firstRow int
- The 1-based first row to delete.
- count int = 1
- The number of rows to delete.
Exceptions
ArgumentOutOfRangeException– Thrown when the requested rows fall outside the worksheet row limit.InvalidOperationException– Thrown when the deletion would remove an owned table boundary or intersect an array-formula, data-table, or PivotTable output range that cannot be rebuilt safely, when the workbook uses R1C1 reference mode, or when the worksheet contains unsupported form controls, OLE objects, or single-cell XML mappings.
public ExcelMutationResult DeleteRowsTransactional(int firstRow, int count = 1, ExcelMutationPlanOptions? options = null, CancellationToken cancellationToken = default) #Plans and transactionally deletes rows with bounded rollback and post-edit diagnostics.
Parameters
- firstRow int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
ExcelMutationResultpublic IEnumerable<ExcelCellValueInfo> EnumerateCells(ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the non-empty cells in this worksheet without probing every coordinate in its used range. Enumerate the returned sequence while the owning ExcelDocument is still open.
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Optional read options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token observed during enumeration.
Returns
IEnumerable<ExcelCellValueInfo>public IEnumerable<ExcelCellValueInfo> EnumerateRange(string a1Range, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the non-empty cells in the specified A1 range without probing every coordinate in the range. Enumerate the returned sequence while the owning ExcelDocument is still open.
Parameters
- a1Range string
- Inclusive A1 range (for example, "A1:C100").
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Optional read options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token observed during enumeration.
Returns
IEnumerable<ExcelCellValueInfo>public IReadOnlyList<ExcelCommentInfo> FindComments(ExcelCommentFilter? filter) #Finds legacy worksheet comments (notes) that match the supplied filter.
Parameters
- filter OfficeIMO.Excel.ExcelCommentFilter?
- Optional author, text, and A1 range filter.
Returns
IReadOnlyList<ExcelCommentInfo>public string? FindFirst(string text) #Finds the first cell text that contains the specified value. Returns the A1 address or null. Searches values rendered as text (shared strings, inline strings, numbers as invariant strings).
Parameters
- text string
Returns
string?public void ForEachColumn(string a1, Action<int> action) #Iterates over column indices inside an A1 range and invokes action for each column.
Parameters
- a1 string
- A1 range without a sheet prefix.
- action System.Action<int>
- Callback receiving a 1-based column index.
Examples
sheet.ForEachRow("A2:A10", r => sheet.SetInternalLink(r, 1, "'Summary'!A1", "Back"));
public void ForEachRow(string a1, Action<int> action) #Iterates over row indices inside an A1 range and invokes action for each row.
Parameters
- a1 string
- A1 range without a sheet prefix.
- action System.Action<int>
- Callback receiving a 1-based row index.
Examples
var bounds = sheet.GetRangeBounds("A2:D20"); // bounds.r1=2, bounds.c1=1, bounds.r2=20, bounds.c2=4
public string FromXml(string xml, int startRow = 1, int startColumn = 1, bool includeHeaders = false, ExcelXmlTableOptions? options = null, ExcelExecutionMode? mode = null) #Inserts a positional or explicitly mapped XML table and returns the inserted A1 range. Text remains literal, including formula-looking strings. The XML is fully admitted and converted before worksheet mutation.
Parameters
- xml string
- XML table text, separate from an XML Spreadsheet workbook.
- startRow int = 1
- First destination row, one-based.
- startColumn int = 1
- First destination column, one-based.
- includeHeaders bool = false
- Writes mapped column names, or positional Column1, Column2 names.
- options OfficeIMO.Excel.ExcelXmlTableOptions? = null
- Explicit schema and resource limits.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Existing worksheet insertion execution mode.
Returns
stringpublic string FromXml(Stream input, int startRow = 1, int startColumn = 1, bool includeHeaders = false, ExcelXmlTableOptions? options = null, ExcelExecutionMode? mode = null) #Inserts a bounded XML table from a caller-owned stream; the stream remains open.
Parameters
- input System.IO.Stream
- Readable XML table stream.
- startRow int = 1
- First destination row, one-based.
- startColumn int = 1
- First destination column, one-based.
- includeHeaders bool = false
- Writes mapped or positional column headers.
- options OfficeIMO.Excel.ExcelXmlTableOptions? = null
- Explicit schema and resource limits.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Existing worksheet insertion execution mode.
Returns
stringpublic IReadOnlyDictionary<string, string> GetAllNamedRanges() #Returns all defined names visible to this sheet with their A1 ranges.
Returns
IReadOnlyDictionary<string, string>public IReadOnlyList<ExcelAllowedEditRangeInfo> GetAllowedEditRanges() #Lists allowed-edit regions without exposing Open XML types.
Returns
IReadOnlyList<ExcelAllowedEditRangeInfo>public IReadOnlyList<ExcelAutoFilterInfo> GetAutoFilters() #Reads worksheet and table AutoFilter criteria/state.
Returns
IReadOnlyList<ExcelAutoFilterInfo>public IReadOnlyList<ExcelNativeCellValueInfo?> GetCellValueSnapshots(int column, int firstRow, int lastRow) #Reads the native value metadata of one column for a range of rows in a single pass.
Parameters
- column int
- The 1-based column index to read.
- firstRow int
- The 1-based first row to read.
- lastRow int
- The 1-based last row to read.
Returns
IReadOnlyList<ExcelNativeCellValueInfo?> One snapshot or null per row from firstRow to lastRow.public ExcelChart? GetChart(string name) #Returns a chart by name (non-visual name), or null if not found.
Parameters
- name string
Returns
ExcelChart?public IReadOnlyList<ExcelColumnInfo> GetColumnDefinitions() #Gets explicit worksheet column definitions such as custom widths and hidden ranges.
Returns
IReadOnlyList<ExcelColumnInfo>public IReadOnlyList<ExcelColumnInfo> GetColumnDefinitions(CancellationToken cancellationToken) #Gets explicit worksheet column definitions, observing cancellation while deferred data is materialized.
Parameters
- cancellationToken System.Threading.CancellationToken
- Cancels deferred materialization and column inspection.
Returns
IReadOnlyList<ExcelColumnInfo>Exceptions
OperationCanceledException– The operation was canceled.
public string GetColumnRangeByHeader(string headerName, string? tableName = null, int headerRow = 0, bool includeHeader = false, bool normalizeHeader = true) #Resolves the data range for a worksheet or table column by matching its header text.
Parameters
- headerName string
- Header or table column name to match.
- tableName string? = null
- Optional table name, display name, or range. When omitted, the worksheet header row is scanned.
- headerRow int = 0
- Worksheet header row to scan when tableName is omitted. Use 0 to scan the first row of the used range.
- includeHeader bool = false
- Include the matched header cell in the returned range.
- normalizeHeader bool = true
- Normalize repeated whitespace before comparing headers.
Returns
string A single-column A1 range for the matched column.public IReadOnlyList<ExcelCommentInfo> GetComments() #Gets all legacy worksheet comments (notes) on this sheet.
Returns
IReadOnlyList<ExcelCommentInfo>public IReadOnlyList<ExcelConditionalFormattingInfo> GetConditionalFormattingRules(string? a1Range = null) #Lists conditional formatting rules on the worksheet.
Parameters
- a1Range string? = null
Returns
IReadOnlyList<ExcelConditionalFormattingInfo>public IReadOnlyList<ExcelDataValidationInfo> GetDataValidations(string? a1Range = null) #Lists data validation rules on the worksheet.
Parameters
- a1Range string? = null
Returns
IReadOnlyList<ExcelDataValidationInfo>public IReadOnlyList<ExcelFormulaCellInfo> GetFormulaCells() #Returns formula cells on this sheet without changing workbook contents.
Returns
IReadOnlyList<ExcelFormulaCellInfo>public string? GetFormulaText(int row, int column) #Returns the formula text from a cell, if present.
Parameters
- row int
- column int
Returns
string?public Dictionary<string, int> GetHeaderMap(ExcelReaderOptions? options = null) #Builds or returns a cached case-insensitive map of header name to 1-based column index using the first row of UsedRange. Cache reuse respects the used range, header conversion options and named-style replacements.
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
Returns
Dictionary<string, int>public IReadOnlyDictionary<string, ExcelHyperlinkInfo> GetHyperlinks() #Gets worksheet hyperlinks keyed by their A1 cell or range reference.
Returns
IReadOnlyDictionary<string, ExcelHyperlinkInfo>public IReadOnlyList<ExcelIgnoredErrorRegionInfo> GetIgnoredErrorRegions() #Lists standard ignored-error regions without exposing Open XML types.
Returns
IReadOnlyList<ExcelIgnoredErrorRegionInfo>public ExcelImage? GetImage(string name) #Returns an image by non-visual drawing name, or null if it was not found.
Parameters
- name string
Returns
ExcelImage?public IReadOnlyList<ExcelInCellImage> GetInCellImages(long maximumTotalImageBytes = 64000000) #Reads native in-cell images with a deterministic aggregate payload budget.
Parameters
- maximumTotalImageBytes long = 64000000
Returns
IReadOnlyList<ExcelInCellImage>public IReadOnlyList<int> GetManualColumnPageBreaks() #Gets one-based worksheet columns that have a manual page break after them.
Returns
IReadOnlyList<int>public IReadOnlyList<int> GetManualRowPageBreaks() #Gets one-based worksheet rows that have a manual page break after them.
Returns
IReadOnlyList<int>public IReadOnlyList<ExcelMergedRangeInfo> GetMergedRanges() #Gets worksheet merged ranges as reusable one-based A1 metadata.
Returns
IReadOnlyList<ExcelMergedRangeInfo>public IReadOnlyList<ExcelMergedRangeInfo> GetMergedRanges(int maximumRanges) #Gets worksheet merged ranges while rejecting collections beyond the configured inspection limit.
Parameters
- maximumRanges int
- Maximum merge records inspected.
Returns
IReadOnlyList<ExcelMergedRangeInfo>public ExcelModernChart? GetModernChart(string name) #Returns a native or imported ChartEx drawing by non-visual name.
Parameters
- name string
Returns
ExcelModernChart?public ExcelRange? GetNamedRange(string name) #Gets the range a defined name refers to, preferring a name local to this sheet over a workbook name.
Parameters
- name string
- Defined name to resolve.
Returns
ExcelRange? The range, or null when the name is missing or is not one cell range on an existing worksheet.public ExcelCellData GetPivotData(string pivotTableName, string dataField, IReadOnlyDictionary<string, object?>? items = null) #Reads a value from a saved pivot view, without refreshing its source or cache. Supports saved hierarchies, qualified date, numeric and manual text groups, default subtotals, collapsed groups and multiple measures. Unknown fields, items, measures or pivots return a typed #REF! error.
Parameters
- pivotTableName string
- Saved pivot definition on this worksheet.
- dataField string
- Measure caption or unique source field name.
- items System.Collections.Generic.IReadOnlyDictionary<string, object?>? = null
- Field criteria. Dates accept DateTime or workbook serials; error items use an ExcelCellData error, distinct from text with the same spelling.
Returns
ExcelCellDataExceptions
NotSupportedException– The view has no materialized items or uses an unsupported layout or exceeds lookup limits.
public string GetPivotTableRange(string pivotTableName, ExcelPivotRangeTarget target = WholeTable) #Resolves the output range for a pivot table on this worksheet.
Parameters
- pivotTableName string
- target OfficeIMO.Excel.ExcelPivotRangeTarget = WholeTable
Returns
stringpublic IReadOnlyList<ExcelPivotTableInfo> GetPivotTables() #Returns pivot tables defined on this worksheet.
Returns
IReadOnlyList<ExcelPivotTableInfo>public ValueTuple<int, int, int, int> GetRangeBounds(string a1) #Parses an A1 range and returns 1-based bounds (r1, c1, r2, c2).
Parameters
- a1 string
- A1 range without a sheet prefix (e.g., "A2:D20").
Returns
ValueTuple<int, int, int, int> Tuple of (r1, c1, r2, c2) with normalized bounds.Exceptions
ArgumentException– Thrown when the input is not a valid A1 range.
public ValueTuple<OfficeLength, OfficeLength> GetRangeSize(string range) #Returns the authored dimensions of an A1 range using current column widths, row heights and hidden cells.
Parameters
- range string
Returns
ValueTuple<OfficeLength, OfficeLength>public IReadOnlyList<ExcelRowInfo> GetRowDefinitions() #Gets explicit worksheet row definitions such as custom heights and hidden rows.
Returns
IReadOnlyList<ExcelRowInfo>public IReadOnlyList<ExcelSparklineInfo> GetSparklines() #Lists authored worksheet sparklines in package order.
Returns
IReadOnlyList<ExcelSparklineInfo>public string? GetTableRange(string tableName) #Gets the A1 range covered by a table on this worksheet.
Parameters
- tableName string
- Table name or display name.
Returns
string? The table reference, or null when no matching table exists.public IReadOnlyList<ExcelTableInfo> GetTables() #Returns the named Excel table definitions owned by this worksheet. Ordinary cell grids are not named tables. Metadata is read through the same locked snapshot owner as ExcelDocument.GetTables.
Returns
IReadOnlyList<ExcelTableInfo>Exceptions
InvalidOperationException– The worksheet was removed or no longer belongs to the current workbook package.
public ExcelThreadedCommentInfo? GetThreadedComment(string id) #Gets a threaded comment or reply by id, or null when it is not present on this worksheet.
Parameters
- id string
Returns
ExcelThreadedCommentInfo?public IReadOnlyList<ExcelThreadedCommentInfo> GetThreadedComments() #Gets all threaded comments and replies on this worksheet.
Returns
IReadOnlyList<ExcelThreadedCommentInfo>public void GroupColumns(int startColumn, int endColumn, byte outlineLevel = 1, bool collapsed = false, bool hidden = false) #Groups a contiguous range of worksheet columns by applying an Excel outline level.
Parameters
- startColumn int
- First 1-based column in the group.
- endColumn int
- Last 1-based column in the group.
- outlineLevel byte = 1
- Excel outline level from 1 through 7.
- collapsed bool = false
- Whether to hide the grouped columns and mark the summary column as collapsed.
- hidden bool = false
- Whether to hide the grouped columns without marking the group as collapsed.
public void GroupRows(int startRow, int endRow, byte outlineLevel = 1, bool collapsed = false, bool hidden = false) #Groups a contiguous range of worksheet rows by applying an Excel outline level.
Parameters
- startRow int
- First 1-based row in the group.
- endRow int
- Last 1-based row in the group.
- outlineLevel byte = 1
- Excel outline level from 1 through 7.
- collapsed bool = false
- Whether to hide the grouped rows and mark the summary row as collapsed.
- hidden bool = false
- Whether to hide the grouped rows without marking the group as collapsed.
public bool HasComment(int row, int column) #Returns true when a comment exists for the specified cell.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
Returns
boolpublic ExcelMutationResult InsertCells(string range, ExcelCellShiftDirection direction, ExcelMutationPlanOptions? options = null, CancellationToken cancellationToken = default) #Transactionally inserts cells.
Parameters
- range string
- direction OfficeIMO.Excel.ExcelCellShiftDirection
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
ExcelMutationResultpublic void InsertColumns(int firstColumn, int count = 1) #Inserts blank worksheet columns immediately before firstColumn and shifts existing columns right. Formulas, defined names, tables, merges, comments, hyperlinks, validations, conditional formatting, drawings, page breaks and connection parameters are adjusted where supported. Use ExcelSheet.InsertColumnsTransactional for rollback and post-edit diagnostics.
Parameters
- firstColumn int
- count int = 1
Exceptions
ArgumentOutOfRangeException– The requested columns fall outside the worksheet column limit.InvalidOperationException– Content or a dependent reference would exceed the column limit, or the insertion would split an array formula, data table or PivotTable output range, or the worksheet contains unsupported controls.
public ExcelMutationResult InsertColumnsTransactional(int firstColumn, int count = 1, ExcelMutationPlanOptions? options = null, CancellationToken cancellationToken = default) #Plans and transactionally inserts columns with bounded rollback and post-edit diagnostics.
Parameters
- firstColumn int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
ExcelMutationResultpublic string InsertDataReader(IDataReader reader, int startRow = 1, int startColumn = 1, bool includeHeaders = true, string? tableName = null, ExcelTableStyle style = TableStyleMedium2, bool includeAutoFilter = true, bool createTable = true, bool autoFit = false, CancellationToken ct = default) #Streams rows from an IDataReader (including provider-owned DbDataReader implementations) into the worksheet and optionally creates an Excel table. The caller owns the connection, command, query, and provider. Null and DBNull values remain blank cells; an empty string remains text.
Parameters
- reader System.Data.IDataReader
- Open data reader positioned before the first row.
- startRow int = 1
- 1-based start row.
- startColumn int = 1
- 1-based start column.
- includeHeaders bool = true
- Write field names as the first row.
- tableName string? = null
- Optional Excel table name.
- style OfficeIMO.Excel.ExcelTableStyle = TableStyleMedium2
- Excel table style to use when createTable is true.
- includeAutoFilter bool = true
- Include table AutoFilter dropdowns when creating a table.
- createTable bool = true
- Create an Excel table over the imported range.
- autoFit bool = false
- Auto-fit imported columns after rows are written.
- ct System.Threading.CancellationToken = default
- Cancellation token.
Returns
string A1 range occupied by the imported reader data.public ExcelDataReaderInsertResult InsertDataReaderWithResult(IDataReader reader, int startRow = 1, int startColumn = 1, bool includeHeaders = true, string? tableName = null, ExcelTableStyle style = TableStyleMedium2, bool includeAutoFilter = true, bool createTable = true, bool autoFit = false, CancellationToken ct = default) #Streams rows from an IDataReader into the worksheet and returns the occupied range, actual table name, and imported dimensions.
Parameters
- reader System.Data.IDataReader
- Open data reader positioned before the first row.
- startRow int = 1
- 1-based start row.
- startColumn int = 1
- 1-based start column.
- includeHeaders bool = true
- Write field names as the first row.
- tableName string? = null
- Optional Excel table name.
- style OfficeIMO.Excel.ExcelTableStyle = TableStyleMedium2
- Excel table style to use when createTable is true.
- includeAutoFilter bool = true
- Include table AutoFilter dropdowns when creating a table.
- createTable bool = true
- Create an Excel table over the imported range.
- autoFit bool = false
- Auto-fit imported columns after rows are written.
- ct System.Threading.CancellationToken = default
- Cancellation token.
Returns
ExcelDataReaderInsertResult Details of the imported rows and the actual table created by OfficeIMO.public void InsertRows(int firstRow, int count = 1) #Inserts blank worksheet rows immediately before firstRow and shifts existing rows down. Formulas, defined names, tables, merges, comments, hyperlinks, validations, conditional formatting, sparklines, drawings, and chart references owned by the workbook are adjusted where supported.
Parameters
- firstRow int
- The 1-based row before which new rows are inserted.
- count int = 1
- The number of rows to insert.
Exceptions
ArgumentOutOfRangeException– Thrown when the requested rows fall outside the worksheet row limit.InvalidOperationException– Thrown when content or a dependent reference would exceed the worksheet row limit, or when the insertion would split an array formula, data-table, or PivotTable output range, when the workbook uses R1C1 reference mode, or when the worksheet contains unsupported form controls, OLE objects, or single-cell XML mappings.
public ExcelMutationResult InsertRowsTransactional(int firstRow, int count = 1, ExcelMutationPlanOptions? options = null, CancellationToken cancellationToken = default) #Plans and transactionally inserts rows with bounded rollback and post-edit diagnostics.
Parameters
- firstRow int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
ExcelMutationResultpublic ExcelFormulaInspection InspectFormulas() #Inspects formula cells on this sheet without changing workbook contents.
Returns
ExcelFormulaInspectionpublic ExcelTemplateInspection InspectTemplate() #Inspects {{Marker}} placeholders on this worksheet without modifying it.
Returns
ExcelTemplateInspectionpublic ExcelTemplateInspection InspectTemplate(IDictionary<string, object?> values) #Inspects {{Marker}} placeholders on this worksheet 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 on this worksheet and reports which markers are missing from public properties on the supplied model.
Parameters
- model object
Returns
ExcelTemplateInspectionpublic void InvalidateFormulas() #Marks all formula cells on this sheet dirty.
public static bool IsSupportedImageContentType(string? contentType) #Determines whether an image content type can be stored in an Excel image part.
Parameters
- contentType string?
- The MIME content type to inspect.
Returns
bool true when the content type maps to an Excel image part; otherwise false.public ExcelLinkByHeaderResult LinkByHeader(string header, ExcelLinkTarget target, ExcelLinkByHeaderOptions? options = null) #Turns each non-empty cell under a header into a link to a worksheet or URL built from the cell text.
Parameters
- header string
- Header text of the column to link (case-insensitive).
- target OfficeIMO.Excel.ExcelLinkTarget
- Where each cell points: ExcelLinkTarget.Sheet or ExcelLinkTarget.Url.
- options OfficeIMO.Excel.ExcelLinkByHeaderOptions? = null
- Optional range or table scope, row bounds, display text and styling.
Returns
ExcelLinkByHeaderResult The linked column and count, the skipped cells, or why nothing was linked.Examples
sheet.LinkByHeader("Domain", ExcelLinkTarget.Sheet()); sheet.LinkByHeader("RFC", ExcelLinkTarget.Url(rfc => $"https://datatracker.ietf.org/doc/html/{rfc}"), new ExcelLinkByHeaderOptions { Table = "Summary" });
public void LinkCellsToInternalSheets(string a1, Func<string, string> destinationSheetForCellText, string targetA1 = "A1", Func<string, string>? display = null, bool styled = true) #Converts each non-empty cell in the A1 range into an internal hyperlink. The destination sheet name is computed from the cell's text using destinationSheetForCellText.
Parameters
- a1 string
- A1 range to process (e.g., a column of names).
- destinationSheetForCellText System.Func<string, string>
- Maps the cell text to a destination sheet name.
- targetA1 string = "A1"
- Destination cell on the target sheet (default "A1").
- display System.Func<string, string>? = null
- Optional display text selector. Defaults to the cell text.
- styled bool = true
- When true, applies hyperlink styling (blue + underline).
Examples
sheet.ForEachColumn("A1:E1", c => sheet.CellBold(1, c, true));
public ExcelPivotMaterializationResult MaterializePivotTable(string pivotTableName, ExcelMutationPlanOptions? options = null, CancellationToken cancellationToken = default, DateTime? referenceDate = null) #Generates saved pivot views and their shared source cache from current worksheet values. Supports up to 256 measures and fields across ordinary, numeric-range, derived date and manual text group axes, selected page items, hidden row, column, or page items, deterministic first-seen key order, and optional grand totals. Source formulas use their saved typed caches.
Parameters
- pivotTableName string
- Pivot definition on this worksheet.
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
- Source, measure-input, output and rollback limits. Each cell/work budget uses MaximumAffectedCells, capped at one million.
- cancellationToken System.Threading.CancellationToken = default
- Cancels preparation or rolls back an interrupted write.
- referenceDate System.DateTime? = null
- Local calendar date used for relative date filters. Defaults to today's date, captured once for all shared-cache views.
Exceptions
NotSupportedException– A cache view uses an unqualified grouping, filter, calculated field, measure layout, or incompatible cache representation.InvalidOperationException– A budget or destination collision prevents generation.
public ExcelStructuralMutationPlan PlanCopyRange(string sourceRange, string destinationTopLeft, ExcelMutationPlanOptions? options = null) #Plans a formula-aware cell-range copy.
Parameters
- sourceRange string
- destinationTopLeft string
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelStructuralMutationPlanpublic ExcelStructuralMutationPlan PlanDeleteCells(string range, ExcelCellShiftDirection direction, ExcelMutationPlanOptions? options = null) #Plans deletion of a rectangular cell block.
Parameters
- range string
- direction OfficeIMO.Excel.ExcelCellShiftDirection
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelStructuralMutationPlanpublic ExcelStructuralMutationPlan PlanDeleteColumns(int firstColumn, int count = 1, ExcelMutationPlanOptions? options = null) #Builds a bounded dry-run plan for deleting complete worksheet columns.
Parameters
- firstColumn int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelStructuralMutationPlanpublic ExcelRowMutationPlan PlanDeleteRows(int firstRow, int count = 1, ExcelMutationPlanOptions? options = null) #Validates and describes a deletion without changing the workbook.
Parameters
- firstRow int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelRowMutationPlanpublic ExcelStructuralMutationPlan PlanInsertCells(string range, ExcelCellShiftDirection direction, ExcelMutationPlanOptions? options = null) #Plans insertion of a rectangular cell block.
Parameters
- range string
- direction OfficeIMO.Excel.ExcelCellShiftDirection
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelStructuralMutationPlanpublic ExcelStructuralMutationPlan PlanInsertColumns(int firstColumn, int count = 1, ExcelMutationPlanOptions? options = null) #Builds a bounded dry-run plan for inserting complete worksheet columns.
Parameters
- firstColumn int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelStructuralMutationPlanpublic ExcelRowMutationPlan PlanInsertRows(int firstRow, int count = 1, ExcelMutationPlanOptions? options = null) #Validates and describes an insertion without changing the workbook.
Parameters
- firstRow int
- count int = 1
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelRowMutationPlanpublic ExcelStructuralMutationPlan PlanMoveRange(string sourceRange, string destinationTopLeft, ExcelMutationPlanOptions? options = null) #Plans a formula-aware cell-range move.
Parameters
- sourceRange string
- destinationTopLeft string
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelStructuralMutationPlanpublic ExcelStructuralMutationPlan PlanTransposeRange(string sourceRange, string destinationTopLeft, ExcelMutationPlanOptions? options = null) #Plans a formula-aware transposed copy.
Parameters
- sourceRange string
- destinationTopLeft string
- options OfficeIMO.Excel.ExcelMutationPlanOptions? = null
Returns
ExcelStructuralMutationPlanpublic void Protect(ExcelSheetProtectionOptions? options = null) #Applies worksheet protection using the provided options.
Parameters
- options OfficeIMO.Excel.ExcelSheetProtectionOptions? = null
- Protection options (defaults allow selection of locked/unlocked cells).
public void ProtectTableEditing(string? password = null) #Applies worksheet protection with permissions for common Excel table editing workflows.
Parameters
- password string? = null
public ExcelRange Range(string a1Range) #Returns a range by A1 address, such as A1:V1. A single cell reference returns a one-cell range.
Parameters
- a1Range string
Returns
ExcelRangepublic ExcelRange Range(int firstRow, int firstColumn, int lastRow, int lastColumn) #Returns the range between two 1-based corner cells.
Parameters
- firstRow int
- firstColumn int
- lastRow int
- lastColumn int
Returns
ExcelRangeExceptions
ArgumentOutOfRangeException– A corner is outside the worksheet or the corners are reversed.
public int RecalculateSupportedFormulas() #Evaluates supported formulas on this sheet and writes cached results.
Returns
intpublic void RefreshHeaderCache(ExcelReaderOptions? options = null) #Forces rebuilding the header map for the current UsedRange and options.
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
public bool RemoveAllowedEditRange(string name) #Removes a named allowed-edit region.
Parameters
- name string
Returns
boolpublic void RemoveConditionalFormattingRule(ExcelConditionalFormattingInfo rule) #Removes one attached conditional-formatting rule.
Parameters
- rule OfficeIMO.Excel.ExcelConditionalFormattingInfo
public void RemoveDataValidations(string? a1Range = null) #Removes data validation rules, optionally restricted to a range.
Parameters
- a1Range string? = null
public int RemoveIgnoredErrorRegions(string range) #Removes every standard ignored-error region overlapping the supplied A1 cell or range.
Parameters
- range string
Returns
intpublic bool RemoveInCellImage(int row, int column) #Removes the in-cell image value from one cell. Shared rich-data assets remain available to copied cells.
Parameters
- row int
- column int
Returns
boolpublic bool RemoveManualColumnPageBreak(int column, bool save = true) #Removes a manual worksheet column page break.
Parameters
- column int
- save bool = true
Returns
boolpublic bool RemoveManualRowPageBreak(int row, bool save = true) #Removes a manual worksheet row page break.
Parameters
- row int
- save bool = true
Returns
boolpublic bool RemoveNamedRange(string name, bool save = true) #Removes a defined name scoped to this sheet.
Parameters
- name string
- Defined name to remove.
- save bool = true
- When true, saves the workbook after removal.
Returns
bool True if removed; false if not found.public int RemoveSparklines(string locationRange) #Removes every sparkline whose destination intersects a range and prunes empty groups.
Parameters
- locationRange string
Returns
intpublic int RemoveTemplateOptionalRows(int firstRow, int rowCount) #Removes an optional worksheet row block and shifts following worksheet rows up.
Parameters
- firstRow int
- 1-based first row in the optional block.
- rowCount int
- Number of rows in the optional block.
Returns
intpublic bool RemoveThreadedComment(string id, bool removeReplies = true) #Removes a threaded comment. Root-comment removal includes its reply tree by default.
Parameters
- id string
- Threaded comment id.
- removeReplies bool = true
- Whether replies and imported descendant replies should be removed with the comment.
Returns
boolpublic int RemoveThreadedCommentsAt(string address) #Removes every threaded comment and reply attached to a worksheet cell.
Parameters
- address string
Returns
intpublic string RenameTable(string tableOrRange, string newName, ExcelTableNameValidationMode validationMode = Strict) #Renames a table and every parsed structured reference to it across the workbook.
Parameters
- tableOrRange string
- newName string
- validationMode OfficeIMO.Excel.ExcelTableNameValidationMode = Strict
Returns
stringpublic void ReorderConditionalFormattingRules(IReadOnlyList<ExcelConditionalFormattingInfo> orderedRules) #Reassigns consecutive priorities in the supplied order. The sequence must contain every currently attached rule exactly once.
Parameters
- orderedRules System.Collections.Generic.IReadOnlyList<OfficeIMO.Excel.ExcelConditionalFormattingInfo>
public int ReplaceAll(string oldText, string newText) #Replaces all occurrences of oldText with newText in string cells. Returns the number of replacements performed.
Parameters
- oldText string
- newText string
Returns
intpublic ExcelThreadedCommentResult ReplyToThreadedComment(string parentId, string text, string author = "OfficeIMO", DateTime? date = null, string? id = null) #Adds a reply using the worksheet and cell of an existing root threaded comment.
Parameters
- parentId string
- text string
- author string = "OfficeIMO"
- date System.DateTime? = null
- id string? = null
Returns
ExcelThreadedCommentResultpublic ExcelReportBuilder Report(ExcelReportOptions? options = null) #Starts a report builder on this worksheet. Existing cells are retained until report content writes them.
Parameters
- options OfficeIMO.Excel.ExcelReportOptions? = null
Returns
ExcelReportBuilderpublic IReadOnlyList<ExcelTableColumnInfo> ResizeTable(string tableOrRange, string newRange) #Resizes a table while retaining its current ordered column names.
Parameters
- tableOrRange string
- newRange string
Returns
IReadOnlyList<ExcelTableColumnInfo>public IEnumerable<T> RowsAsParallel<T>(ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects the used range in bounded parallel batches by matching headers to writable public properties. The worksheet reader remains single-owner and results retain source order.
Type Parameters
- T
Parameters
- parallelOptions OfficeIMO.Data.ParallelRowMappingOptions? = null
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T>public IEnumerable<T> RowsAsParallel<T>(Action<RowMapper<T>> configure, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects the used range in bounded parallel batches with explicit, AOT-friendly assignments.
Type Parameters
- T
Parameters
- 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 IEnumerable<T> RowsAsParallel<T>(Func<IDataRecord, T> factory, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects the used range in bounded parallel batches with a caller-supplied factory.
Type Parameters
- T
Parameters
- 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 IEnumerable<T> RowsAsParallel<T>(string a1Range, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects an A1 range in bounded parallel batches by matching its first row to writable public properties. Results retain source order.
Type Parameters
- T
Parameters
- a1Range string
- parallelOptions OfficeIMO.Data.ParallelRowMappingOptions? = null
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T>public IEnumerable<T?> RowsAsParallel<T>(string a1Range, Action<RowMapper<T?>> configure, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects an A1 range in bounded parallel batches with explicit, AOT-friendly assignments.
Type Parameters
- T
Parameters
- a1Range string
- 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 IEnumerable<T?> RowsAsParallel<T>(string a1Range, Func<IDataRecord, T?> factory, ParallelRowMappingOptions? parallelOptions = null, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Projects an A1 range in bounded parallel batches with a caller-supplied factory.
Type Parameters
- T
Parameters
- a1Range string
- 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 IEnumerable<T> RowsAs<T>(ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the sheet's used range as instances of T using header-to-property mapping. Enumerate the returned sequence while the owning ExcelDocument remains open.
Type Parameters
- T
Parameters
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Optional read options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token observed during enumeration.
Returns
IEnumerable<T>public IEnumerable<T?> RowsAs<T>(Action<RowMapper<T?>> configure, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the sheet's used range as instances of T using explicit, AOT-friendly column assignments. Enumerate the returned sequence while the owning ExcelDocument remains open.
Type Parameters
- T
Parameters
- configure System.Action<OfficeIMO.Data.RowMapper<T?>>
- Configures the column assignments.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Optional read options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token observed during enumeration.
Returns
IEnumerable<T?>public IEnumerable<T?> RowsAs<T>(Func<IDataRecord, T?> factory, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the sheet's used range with a caller-supplied factory. This overload supports constructor-bound and other models without a public parameterless constructor. Enumerate the returned sequence while the owning ExcelDocument remains open.
Type Parameters
- T
Parameters
- factory System.Func<System.Data.IDataRecord, T?>
- Creates one model instance from the current row.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Optional read options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token observed during enumeration.
Returns
IEnumerable<T?>public IEnumerable<T?> RowsAs<T>(string a1Range, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the specified A1 range as instances of T using header-to-property mapping. Enumerate the returned sequence while the owning ExcelDocument remains open.
Type Parameters
- T
Parameters
- a1Range string
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
IEnumerable<T?>public IEnumerable<T?> RowsAs<T>(string a1Range, Action<RowMapper<T?>> configure, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the specified A1 range as instances of T using explicit, AOT-friendly column assignments. Enumerate the returned sequence while the owning ExcelDocument remains open.
Type Parameters
- T
Parameters
- a1Range string
- Inclusive A1 range containing the header and data rows.
- configure System.Action<OfficeIMO.Data.RowMapper<T?>>
- Configures the column assignments.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Optional read options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token observed during enumeration.
Returns
IEnumerable<T?>public IEnumerable<T?> RowsAs<T>(string a1Range, Func<IDataRecord, T?> factory, ExcelReaderOptions? options = null, CancellationToken cancellationToken = default) #Streams the specified A1 range with a caller-supplied factory. This overload supports constructor-bound and other models without a public parameterless constructor. Enumerate the returned sequence while the owning ExcelDocument remains open.
Type Parameters
- T
Parameters
- a1Range string
- Inclusive A1 range containing the header and data rows.
- factory System.Func<System.Data.IDataRecord, T?>
- Creates one model instance from the current row.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Optional read options.
- cancellationToken System.Threading.CancellationToken = default
- Cancellation token observed during enumeration.
Returns
IEnumerable<T?>public OfficeConversionReport SaveAsImage(string path, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Writes the worksheet to a file and returns its fidelity report.
Parameters
- path string
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeConversionReportpublic OfficeConversionReport SaveAsImage(Stream stream, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Writes the worksheet to a caller-owned stream and returns its fidelity report.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeConversionReportpublic async Task<OfficeConversionReport> SaveAsImageAsync(string path, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously writes the worksheet to a file and returns its fidelity report.
Parameters
- path string
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<OfficeConversionReport>public async Task<OfficeConversionReport> SaveAsImageAsync(Stream stream, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Asynchronously writes the worksheet to a caller-owned stream and returns its fidelity report.
Parameters
- stream System.IO.Stream
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<OfficeConversionReport>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 IReadOnlyList<ExcelFormulaCellInfo> SearchFormulas(ExcelFormulaSearchOptions options) #Searches formula text, function calls, or parsed references on this worksheet.
Parameters
- options OfficeIMO.Excel.ExcelFormulaSearchOptions
Returns
IReadOnlyList<ExcelFormulaCellInfo>public void SetAllowedEditRange(string name, IEnumerable<string> ranges, string? password = null, string? securityDescriptor = null) #Adds or replaces a named allowed-edit region on a protected worksheet.
Parameters
- name string
- ranges System.Collections.Generic.IEnumerable<string>
- password string? = null
- securityDescriptor string? = null
public void SetArrayFormula(string a1Range, string formula) #Sets a shared-free array formula over a range. The top-left cell owns the formula metadata.
Parameters
- a1Range string
- formula string
public void SetByHeader(int rowIndex, string header, object? value, ExcelReaderOptions? options = null) #Sets a cell value in the specified row by resolving the column using the header name. Does nothing when the header cannot be found.
Parameters
- rowIndex int
- header string
- value object?
- options OfficeIMO.Excel.ExcelReaderOptions? = null
public void SetColumnOutline(int columnIndex, byte outlineLevel, bool collapsed = false, bool save = true) #Sets column outline metadata used by Excel grouping.
Parameters
- columnIndex int
- One-based column index.
- outlineLevel byte
- Outline level from 0 through 7.
- collapsed bool = false
- Whether the column is shown as collapsed.
- save bool = true
- Whether to save the worksheet XML immediately.
public void SetColumnWidth(int columnIndex, ExcelColumnWidth width) #Sets the width of the specified column.
Parameters
- columnIndex int
- 1-based column index.
- width OfficeIMO.Excel.ExcelColumnWidth
- The column width.
public void SetColumnWidths(IReadOnlyDictionary<int, ExcelColumnWidth> columnWidths) #Applies positive custom widths together and saves the worksheet XML once. Existing column styles, visibility and outline metadata are preserved.
Parameters
- columnWidths System.Collections.Generic.IReadOnlyDictionary<int, OfficeIMO.Excel.ExcelColumnWidth>
- Widths keyed by 1-based column index. Widths above 255 are clamped.
Exceptions
ArgumentNullException– The width map is null.ArgumentOutOfRangeException– An index is outside the worksheet or a width is non-positive or non-finite.
public void SetComment(int row, int column, string text, string author = "OfficeIMO", string? initials = null) #Adds or replaces a comment on the specified cell.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- text string
- Comment text.
- author string = "OfficeIMO"
- Author name (optional).
- initials string? = null
- Author initials (optional).
public void SetComment(string a1, string text, string author = "OfficeIMO", string? initials = null) #Adds or replaces a comment on the specified A1 cell reference.
Parameters
- a1 string
- A1 cell reference (e.g., "B5").
- text string
- Comment text.
- author string = "OfficeIMO"
- Author name (optional).
- initials string? = null
- Author initials (optional).
public void SetCommentRichText(int row, int column, IEnumerable<ExcelRichTextRun> runs, string author = "OfficeIMO", string? initials = null) #Adds or replaces a rich-text comment on the specified cell.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- runs System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelRichTextRun>
- Rich text runs that make up the comment text.
- author string = "OfficeIMO"
- Author name (optional).
- initials string? = null
- Author initials (optional).
public void SetCommentRichText(string a1, IEnumerable<ExcelRichTextRun> runs, string author = "OfficeIMO", string? initials = null) #Adds or replaces a rich-text comment on the specified A1 cell reference.
Parameters
- a1 string
- A1 cell reference (e.g., "B5").
- runs System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelRichTextRun>
- Rich text runs that make up the comment text.
- author string = "OfficeIMO"
- Author name (optional).
- initials string? = null
- Author initials (optional).
public ExcelConditionalFormattingInfo SetConditionalFormattingColors(ExcelConditionalFormattingInfo rule, OfficeColor? color = null, OfficeColor? fillColor = null) #Sets supplied text and solid-fill colors on an attached conditional rule, preserving its other native styling. Returns a fresh editable snapshot. If both colors are omitted, applies the creation theme's Danger text and light Danger fill. When one color is supplied, the other remains unchanged. Native theme roles stay linked to the workbook.
Parameters
- rule OfficeIMO.Excel.ExcelConditionalFormattingInfo
- color OfficeIMO.OfficeColor? = null
- fillColor OfficeIMO.OfficeColor? = null
public void SetDataValidationMessages(string a1Range, ExcelDataValidationMessageOptions options) #Applies prompt/error-message metadata to existing validations that overlap the range.
Parameters
- a1Range string
- options OfficeIMO.Excel.ExcelDataValidationMessageOptions
public void SetDefaultColumnWidth(ExcelColumnWidth width, bool save = true) #Sets the worksheet default column width from characters or a physical length.
Parameters
- width OfficeIMO.Excel.ExcelColumnWidth
- Default column width. Excel supports resolved widths up to 255 character units.
- save bool = true
- Whether to save the worksheet XML immediately.
public void SetDefaultRowHeight(ExcelColumnWidth height, bool hidden = false, bool save = true) #Sets the worksheet default row height from characters or a physical length.
Parameters
- height OfficeIMO.Excel.ExcelColumnWidth
- Default row height. Excel supports physical heights up to 409 points.
- hidden bool = false
- Whether empty rows should be hidden by default.
- save bool = true
- Whether to save the worksheet XML immediately.
public void SetDynamicArrayFormula(string a1Cell, string formula) #Authors a dynamic array at one anchor cell. Calculation determines its bounded spill range.
Parameters
- a1Cell string
- formula string
public void SetHyperlink(int row, int column, string url, string? display = null, bool style = true) #Sets an external hyperlink on a single cell. If display is null or empty, the URL is shown.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- url string
- Target URL.
- display string? = null
- Optional display text. When null/empty, the URL is displayed.
- style bool = true
- When true, applies hyperlink styling (blue + underline).
public void SetHyperlink(int row, int column, string url, string? display, bool style, string? tooltip) #Sets an external hyperlink on a single cell. If display is null or empty, the URL is shown.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- url string
- Target URL.
- display string?
- Optional display text. When null/empty, the URL is displayed.
- style bool
- When true, applies hyperlink styling (blue + underline).
- tooltip string?
- Optional ScreenTip text shown by spreadsheet applications.
public void SetHyperlink(string a1, string url, string? display = null, bool style = true) #Sets an external hyperlink using an A1 reference (e.g., "B5").
Parameters
- a1 string
- A1 cell reference without a sheet prefix.
- url string
- Target URL.
- display string? = null
- Optional display text. When null/empty, the URL is displayed.
- style bool = true
- When true, applies hyperlink styling (blue + underline).
public void SetHyperlink(string a1, string url, string? display, bool style, string? tooltip) #Sets an external hyperlink using an A1 reference (e.g., "B5").
Parameters
- a1 string
- A1 cell reference without a sheet prefix.
- url string
- Target URL.
- display string?
- Optional display text. When null/empty, the URL is displayed.
- style bool
- When true, applies hyperlink styling (blue + underline).
- tooltip string?
- Optional ScreenTip text shown by spreadsheet applications.
public void SetHyperlinkHost(int row, int column, string url, bool style = true) #Creates an external hyperlink showing only the host (e.g., example.org) as display text.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- url string
- Target URL.
- style bool = true
- When true, applies hyperlink styling (blue + underline).
Examples
sheet.SetHyperlinkSmart(5, 1, "https://datatracker.ietf.org/doc/html/rfc7208"); // displays "RFC 7208" sheet.SetHyperlinkSmart(6, 1, "https://example.org/path", title: "Spec"); // displays "Spec"
public void SetHyperlinkReference(int row, int column, string url, bool style = true, string? tooltip = null) #Attaches an external hyperlink to an existing cell without replacing its value or rich-text runs.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- url string
- Target URL.
- style bool = true
- When true, applies the cell-level hyperlink style.
- tooltip string? = null
- Optional ScreenTip text shown by spreadsheet applications.
public void SetHyperlinkSmart(int row, int column, string url, string? title = null, bool style = true) #Creates an external hyperlink using a smart display strategy: prefer title, then an RFC label (e.g., "RFC 7208") when detected, otherwise the URL host.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- url string
- Target URL.
- title string? = null
- Optional preferred display text.
- style bool = true
- When true, applies hyperlink styling (blue + underline).
Examples
// Given a summary table where column A contains sheet names, link each cell to its sheet sheet.LinkCellsToInternalSheets("A2:A51", text => text, targetA1: "A1", styled: true);
public ExcelInCellImage SetInCellImage(int row, int column, byte[] imageBytes, string contentType = "image/png", string? altText = null, long maximumImageBytes = 32000000) #Adds or replaces a native in-cell image without creating a drawing anchor.
Parameters
- row int
- column int
- imageBytes byte[]
- contentType string = "image/png"
- altText string? = null
- maximumImageBytes long = 32000000
Returns
ExcelInCellImagepublic void SetInternalLink(int row, int column, string location, string? display = null, bool style = true) #Sets an internal hyperlink (location in this workbook), e.g., "'Sheet1'!A1".
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- location string
- Target location inside the workbook (e.g., "'Summary'!A1").
- display string? = null
- Optional display text. When null/empty, location is displayed.
- style bool = true
- When true, applies hyperlink styling (blue + underline).
Examples
sheet.SetHyperlink("B5", "https://contoso.com");
public void SetInternalLink(int row, int column, string location, string? display, bool style, string? tooltip) #Sets an internal hyperlink (location in this workbook), e.g., "'Sheet1'!A1".
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- location string
- Target location inside the workbook (e.g., "'Summary'!A1").
- display string?
- Optional display text. When null/empty, location is displayed.
- style bool
- When true, applies hyperlink styling (blue + underline).
- tooltip string?
- Optional ScreenTip text shown by spreadsheet applications.
public void SetInternalLink(int row, int column, ExcelSheet target, string a1, string? display = null, bool style = true) #Sets an internal hyperlink to a target sheet and A1 location using safe quoting rules.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- target OfficeIMO.Excel.ExcelSheet
- Target sheet.
- a1 string
- A1 reference on the target sheet.
- display string? = null
- Optional display text. When null/empty, the location is displayed.
- style bool = true
- When true, applies hyperlink styling (blue + underline).
Examples
// Link A2 to the top of Summary sheet sheet.SetInternalLink(2, 1, "'Summary'!A1", display: "Summary", style: true);
public void SetInternalLink(int row, int column, ExcelSheet target, string a1, string? display, bool style, string? tooltip) #Sets an internal hyperlink to a target sheet and A1 location using safe quoting rules.
Parameters
- row int
- 1-based row index.
- column int
- 1-based column index.
- target OfficeIMO.Excel.ExcelSheet
- Target sheet.
- a1 string
- A1 reference on the target sheet.
- display string?
- Optional display text. When null/empty, the location is displayed.
- style bool
- When true, applies hyperlink styling (blue + underline).
- tooltip string?
- Optional ScreenTip text shown by spreadsheet applications.
public void SetNamedFormula(string name, string formula, bool save = true, bool hidden = false, ExcelDefinedNameValidationMode validationMode = Sanitize) #Creates or replaces a formula definition scoped to this worksheet.
Parameters
- name string
- The defined name used by worksheet formulas.
- formula string
- An Excel expression, with or without a leading equals sign.
- save bool = true
- Whether to persist the workbook change immediately.
- hidden bool = false
- Whether to hide the name in Excel's normal name list.
- validationMode OfficeIMO.Excel.ExcelDefinedNameValidationMode = Sanitize
- How the defined name is validated or sanitized.
public void SetNamedRange(string name, string range, bool save = true, bool hidden = false) #Creates or updates a named range in the workbook, scoped to this sheet.
Parameters
- name string
- Defined name to create or update.
- range string
- A1 range (e.g. "A1:B5").
- save bool = true
- When true, saves the workbook after the change.
- hidden bool = false
- When true, marks the defined name as hidden.
public void SetNamedRange(string name, string range, bool save, bool hidden, ExcelDefinedNameValidationMode validationMode) #Creates or updates a named range in the workbook, scoped to this sheet, with validation control.
Parameters
- name string
- Defined name to create or update.
- range string
- A1 range (e.g. "A1:B5").
- save bool
- When true, saves the workbook after the change.
- hidden bool
- When true, marks the defined name as hidden.
- validationMode OfficeIMO.Excel.ExcelDefinedNameValidationMode
- Controls how the name and range are validated: Sanitize (default) clamps/adjusts; Strict throws on invalid input.
public void SetOutlineSummary(bool? summaryBelow = null, bool? summaryRight = null) #Configures the worksheet outline summary positions shown by Excel.
Parameters
- summaryBelow bool? = null
- Whether row summaries should appear below grouped rows.
- summaryRight bool? = null
- Whether column summaries should appear to the right of grouped columns.
public void SetRowHeight(int rowIndex, ExcelColumnWidth height) #Sets the explicit height of the specified row. Use a non-positive height to clear the custom row height.
Parameters
- rowIndex int
- 1-based row index.
- height OfficeIMO.Excel.ExcelColumnWidth
- Row height as characters or a physical length.
public void SetRowLayout(int rowIndex, ExcelRowLayoutOptions options) #Applies reusable row layout and row-wide cell style options to one worksheet row.
Parameters
- rowIndex int
- The 1-based row index to update.
- options OfficeIMO.Excel.ExcelRowLayoutOptions
- The layout options to apply.
public void SetRowOutline(int rowIndex, byte outlineLevel, bool collapsed = false, bool save = true) #Sets row outline metadata used by Excel grouping.
Parameters
- rowIndex int
- One-based row index.
- outlineLevel byte
- Outline level from 0 through 7.
- collapsed bool = false
- Whether the row is shown as collapsed.
- save bool = true
- Whether to save the worksheet XML immediately.
public void SetRowsLayout(IEnumerable<int> rowIndexes, ExcelRowLayoutOptions options) #Applies the same reusable row layout and row-wide cell style options to multiple worksheet rows.
Parameters
- rowIndexes System.Collections.Generic.IEnumerable<int>
- The 1-based row indexes to update.
- options OfficeIMO.Excel.ExcelRowLayoutOptions
- The layout options to apply.
public int SetSparklineType(string locationRange, ExcelSparklineType type) #Changes the type of every sparkline whose destination intersects a range.
Parameters
- locationRange string
- type OfficeIMO.Excel.ExcelSparklineType
Returns
intpublic void SetTabColor(OfficeColor color) #Sets a literal or theme-based worksheet tab color.
Parameters
- color OfficeIMO.OfficeColor
- A literal RGBA color, native theme role or status color.
public IReadOnlyList<ExcelTableColumnInfo> SetTableSchema(string tableOrRange, IReadOnlyList<string> columnNames, string? newRange = null) #Replaces the ordered table-column schema and optionally resizes the table. The table's top-left cell remains fixed; callers retain control of data outside the new table rectangle.
Parameters
- tableOrRange string
- columnNames System.Collections.Generic.IReadOnlyList<string>
- newRange string? = null
Returns
IReadOnlyList<ExcelTableColumnInfo>public void SetTableStyle(string tableOrRange, ExcelTableStyle style, bool? showFirstColumn = null, bool? showLastColumn = null, bool? showRowStripes = null, bool? showColumnStripes = null) #Updates the visual style flags for the table identified by range, name, or display name.
Parameters
- tableOrRange string
- Table range, name, or display name.
- style OfficeIMO.Excel.ExcelTableStyle
- Table style to apply.
- showFirstColumn bool? = null
- Optional first-column emphasis flag.
- showLastColumn bool? = null
- Optional last-column emphasis flag.
- showRowStripes bool? = null
- Optional row stripe flag.
- showColumnStripes bool? = null
- Optional column stripe flag.
public void SetTableTotals(string range, Dictionary<string, ExcelTableTotalsFunction> byHeader) #Enables a totals row for the table covering range and assigns per-column functions by header name. Supported functions are those in TotalsRowFunctionValues (Sum, Average, Count, Min, Max, etc.) except Custom, which needs a formula. A later call rewrites generated cells; formulas and values written by the caller are kept.
Parameters
- range string
- Address of the table range (for example, "A1:D10") whose totals row should be displayed.
- byHeader System.Collections.Generic.Dictionary<string, OfficeIMO.Excel.ExcelTableTotalsFunction>
- Mapping of table header names to the totals function that should be applied for each column.
public void SetTableTotalsByName(string tableName, IDictionary<string, ExcelTableTotalsFunction> byHeader) #Enables a totals row for the named table and assigns per-column functions by header name.
Parameters
- tableName string
- Table name or display name.
- byHeader System.Collections.Generic.IDictionary<string, OfficeIMO.Excel.ExcelTableTotalsFunction>
- Mapping of table header names to totals functions.
public ExcelThreadedCommentResult SetThreadedCommentResolved(string id, bool resolved = true) #Marks a threaded comment resolved or reopens it.
Parameters
- id string
- resolved bool = true
Returns
ExcelThreadedCommentResultpublic void SetValues(IEnumerable<ValueTuple<int, int, object>> cells, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Writes multiple cell values efficiently, using parallelization when beneficial.
Parameters
- cells System.Collections.Generic.IEnumerable<System.ValueTuple<int, int, object>>
- Collection of cell coordinates and values.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Optional execution mode override.
- ct System.Threading.CancellationToken = default
- Cancellation token.
public void SortUsedRangeByHeader(string header, bool ascending = true) #Sorts the sheet's UsedRange rows in-place (excluding header) by the column resolved via header. Values-only: rewrites cell values; formulas and styles are not preserved. When the header cannot be resolved the sort is skipped.
Parameters
- header string
- ascending bool = true
public void SortUsedRangeByHeaders(params ValueTuple<string, bool>[] keys) #Sorts the sheet's UsedRange rows in-place by multiple headers in the given order (excluding header row). Values-only: rewrites cell values; formulas and styles are not preserved. Missing headers are ignored and when no valid headers remain the sort is skipped.
Parameters
- keys System.ValueTuple<string, bool>[]
public ExcelTable Table(string nameOrRange) #Returns a lightweight object wrapper for a table by name, display name, or range.
Parameters
- nameOrRange string
Returns
ExcelTablepublic DataTable TableToDataTable(string tableName, bool? headersInFirstRow = null, ExcelReaderOptions? options = null, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Reads an Excel table as a DataTable.
Parameters
- tableName string
- headersInFirstRow bool? = null
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- ct System.Threading.CancellationToken = default
Returns
DataTablepublic DataTable ToDataTable(bool headersInFirstRow = true, ExcelReaderOptions? options = null, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Reads the worksheet used range as a DataTable.
Parameters
- headersInFirstRow bool = true
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- ct System.Threading.CancellationToken = default
Returns
DataTablepublic DataTable ToDataTable(string a1Range, bool headersInFirstRow = true, ExcelReaderOptions? options = null, ExcelExecutionMode? mode = null, CancellationToken ct = default) #Reads an A1 range as a DataTable.
Parameters
- a1Range string
- headersInFirstRow bool = true
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- ct System.Threading.CancellationToken = default
Returns
DataTablepublic OfficeImageExportResult ToImage(ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Renders the worksheet using the encoding in OfficeImageExportOptions.Format.
Parameters
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeImageExportResultpublic OfficeImageExportResult ToImage(ExcelImageExportOptions? options, out OfficeConversionReport report, CancellationToken cancellationToken = default) #Renders the worksheet and returns its immutable fidelity report.
Parameters
- options OfficeIMO.Excel.ExcelImageExportOptions?
- report OfficeIMO.OfficeConversionReport
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeImageExportResultpublic OfficeImageExportResult ToImage(OfficeImageExportFormat format, ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Exports a worksheet range or used range as a supported raster format or SVG.
Parameters
- format OfficeIMO.Drawing.OfficeImageExportFormat
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeImageExportResultpublic async Task<OfficeImageExportResult> ToImageAsync(ExcelImageExportOptions? options = null, CancellationToken cancellationToken = default) #Renders the worksheet with cancellation and returns the encoded image and its diagnostics.
Parameters
- options OfficeIMO.Excel.ExcelImageExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<OfficeImageExportResult>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 one or more worksheet image results. Multi-area print areas and manual page-break splits are returned as separate images when requested.
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 worksheet image parts 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 string ToXml(string a1Range, bool headersInFirstRow = false, ExcelXmlTableOptions? options = null, ExcelReaderOptions? readOptions = null, ExcelExecutionMode? mode = null) #Exports a bounded A1 range as a positional or explicitly mapped XML table using cached cell values. This does not export workbook formatting or calculate formulas.
Parameters
- a1Range string
- Explicit worksheet range, bounded before reading.
- headersInFirstRow bool = false
- Uses the first range row as DataTable headers rather than data.
- options OfficeIMO.Excel.ExcelXmlTableOptions? = null
- Explicit schema and resource limits.
- readOptions OfficeIMO.Excel.ExcelReaderOptions? = null
- Existing cell value, date and formula-cache read policy.
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- Existing worksheet reading execution mode.
Returns
stringpublic bool TryGetCachedFormulaValue(int row, int column, out string? value) #Tries to return a formula cell's cached value, decoding string escapes while retaining numeric text precision.
Parameters
- row int
- column int
- value string?
Returns
boolpublic bool TryGetCellText(int row, int column, out string text) #Tries to read the display text of a cell at the given position. Returns false if the cell is blank or out of bounds.
Parameters
- row int
- The 1-based row index of the cell to inspect.
- column int
- The 1-based column index of the cell to inspect.
- text string
- When this method returns, contains the extracted cell text if successful; otherwise, an empty string.
Returns
bool true if text was read successfully; otherwise, false.public bool TryGetCellValueSnapshot(int row, int column, out ExcelNativeCellValueInfo? snapshot) #Tries to read the native value metadata of a cell at the given position.
Parameters
- row int
- The 1-based row index of the cell to inspect.
- column int
- The 1-based column index of the cell to inspect.
- snapshot OfficeIMO.Excel.ExcelNativeCellValueInfo?
- When this method returns, contains the cell value metadata if successful; otherwise, null.
Returns
bool true when the cell exists and carries a value, inline string, or formula.public bool TryGetColumnIndexByHeader(string header, out int columnIndex, ExcelReaderOptions? options = null) #Tries to resolve a 1-based column index for a given header. Returns false without throwing when the header cannot be found.
Parameters
- header string
- columnIndex int
- options OfficeIMO.Excel.ExcelReaderOptions? = null
Returns
boolpublic bool TryGetColumnRangeByHeader(string headerName, string? tableName, int headerRow, bool includeHeader, bool normalizeHeader, out string range) #Tries to resolve the data range for a worksheet or table column by matching its header text.
Parameters
- headerName string
- tableName string?
- headerRow int
- includeHeader bool
- normalizeHeader bool
- range string
Returns
boolpublic bool TryGetColumnStyleByHeader(string header, bool includeHeader, out ExcelColumnStyleByHeaderBuilder builder, out int columnIndex, ExcelReaderOptions? options = null, bool preferDirectTabularMetadata = true) #Attempts to create a column style builder and returns the resolved 1-based column index.
Parameters
- header string
- Header text used to resolve the target column after applying any configured normalization.
- includeHeader bool
- True to include the header row when styling; false to begin styling from the first data row.
- builder OfficeIMO.Excel.ExcelColumnStyleByHeaderBuilder
- When successful, receives a builder for the resolved column.
- columnIndex int
- When successful, receives the resolved 1-based column index.
- options OfficeIMO.Excel.ExcelReaderOptions? = null
- Read options that control header normalization and other resolution behavior.
- preferDirectTabularMetadata bool = true
- True to resolve against pending direct tabular metadata when available; false to force worksheet materialization before resolving.
Returns
boolpublic int UpdateComments(ExcelCommentFilter filter, string text, string? author = null, string? initials = null) #Replaces the text, and optionally author, for comments that match the supplied filter.
Parameters
- filter OfficeIMO.Excel.ExcelCommentFilter
- Author, text, and/or A1 range filter used to choose comments.
- text string
- Replacement comment text.
- author string? = null
- Optional replacement author.
- initials string? = null
- Optional replacement author initials.
Returns
int Number of comments updated.public int UpdateCommentsRichText(ExcelCommentFilter filter, IEnumerable<ExcelRichTextRun> runs, string? author = null, string? initials = null) #Replaces rich text, and optionally author, for comments that match the supplied filter.
Parameters
- filter OfficeIMO.Excel.ExcelCommentFilter
- Author, text, and/or A1 range filter used to choose comments.
- runs System.Collections.Generic.IEnumerable<OfficeIMO.Excel.ExcelRichTextRun>
- Replacement rich text runs.
- author string? = null
- Optional replacement author.
- initials string? = null
- Optional replacement author initials.
Returns
int Number of comments updated.public void UpdateConditionalFormattingRule(ExcelConditionalFormattingInfo rule) #Applies the editable fields of a rule snapshot back to its attached worksheet rule. Unknown attributes and child elements are retained.
Parameters
- rule OfficeIMO.Excel.ExcelConditionalFormattingInfo
public void UpdateDataValidationMessages(string a1Range, Action<ExcelDataValidationMessageOptions> update) #Updates each matching rule independently, preserving fields that the callback does not change.
Parameters
- a1Range string
- A1 range overlapping the rules to update.
- update System.Action<OfficeIMO.Excel.ExcelDataValidationMessageOptions>
- Synchronous mutation of each rule's current message settings.
public ExcelPivotSourceUpdateResult UpdatePivotTableSource(string pivotTableName, ExcelSheet sourceSheet, string sourceRange, ExcelPivotSourceUpdateOptions? options = null) #Changes the worksheet source of an existing pivot table and requests an application refresh on open.
Parameters
- pivotTableName string
- Pivot table name on this worksheet.
- sourceSheet OfficeIMO.Excel.ExcelSheet
- Worksheet that contains the new source data.
- sourceRange string
- New A1 source range including its header row.
- options OfficeIMO.Excel.ExcelPivotSourceUpdateOptions? = null
- Optional header and shared-cache safety settings.
public ExcelThreadedCommentResult UpdateThreadedComment(ExcelThreadedCommentUpdateOptions options) #Updates the text, author, timestamp, or resolved state of an existing threaded comment.
Parameters
- options OfficeIMO.Excel.ExcelThreadedCommentUpdateOptions
Returns
ExcelThreadedCommentResultpublic ExcelChartDataRange WriteChartData(ExcelChartData data, int startRow = 1, int startColumn = 1, string? categoryHeader = null, bool includeHeaderRow = true, bool numericCategories = false, ExcelChartDataOrientation orientation = Vertical) #Writes chart data into the worksheet and returns the corresponding data range.
Parameters
- data OfficeIMO.Excel.ExcelChartData
- startRow int = 1
- startColumn int = 1
- categoryHeader string? = null
- includeHeaderRow bool = true
- numericCategories bool = false
- orientation OfficeIMO.Excel.ExcelChartDataOrientation = Vertical
Returns
ExcelChartDataRangepublic void WriteData(DataTable data, int row = 1, int column = 1, bool includeHeaders = true, ExcelExecutionMode? mode = null, CancellationToken cancellationToken = default) #Writes typed cells from a DataTable without creating a native table or applying table layout defaults.
Parameters
- data System.Data.DataTable
- row int = 1
- column int = 1
- includeHeaders bool = true
- mode OfficeIMO.Excel.ExcelExecutionMode? = null
- cancellationToken System.Threading.CancellationToken = default
public void WriteData<T>(IEnumerable<T?> data, bool includeHeaders = true, int row = 1) #Writes flattened object graphs as plain cells. Null and DBNull remain blank; empty strings remain text.
Type Parameters
- T
Parameters
- data System.Collections.Generic.IEnumerable<T?>
- includeHeaders bool = true
- row int = 1
public void WriteData<T>(IEnumerable<T?> data, params ValueTuple<string, Func<T?, object?>>[] columns) #Writes plain cells through explicit selectors without runtime reflection or table creation.
Type Parameters
- T
Parameters
- data System.Collections.Generic.IEnumerable<T?>
- columns System.ValueTuple<string, System.Func<T?, object?>>[]
public void WriteData<T>(IEnumerable<T?> data, bool includeHeaders, int row, params ValueTuple<string, Func<T?, object?>>[] columns) #Writes plain cells at a chosen row through explicit selectors, preserving duplicate or blank display headers.
Type Parameters
- T
Parameters
- data System.Collections.Generic.IEnumerable<T?>
- includeHeaders bool
- row int
- columns System.ValueTuple<string, System.Func<T?, object?>>[]
Inherited Methods
Properties
public IEnumerable<ExcelChart> Charts { get; } #Enumerates charts on the worksheet.
public ExcelExecutionPolicy? ExecutionOverride { get; set; } #Override execution policy for this sheet. Null = inherit from document.
public IEnumerable<ExcelImage> Images { get; } #Enumerates worksheet images anchored in the drawing layer.
public IEnumerable<ExcelModernChart> ModernCharts { get; } #Enumerates native and imported ChartEx drawings on this worksheet.
public ExcelDocument Document { get; } #Gets the workbook that owns this worksheet.
public ExcelSheetPageSetup PageSetup { get; } #Paper, orientation, scaling, margins, print area and titles, print options, headers and footers.
public ExcelSheetView View { get; } #Frozen panes, gridlines, zero values, headings, direction, zoom and view mode.
public bool IsProtected { get; } #Gets whether the worksheet is protected.
public ExcelRange UsedRange { get; } #Gets the range from the first to the last used cell, including unsaved edits. An empty worksheet returns A1:A1, as Excel does, so the result is never null.
public ExcelColumnWidth? DefaultRowHeight { get; } #Gets the worksheet default row height as a physical dimension, or null when the sheet uses the application default.
public ExcelColumnWidth? DefaultColumnWidth { get; } #Gets the worksheet default column width in character units, or null when the sheet uses the application default.
Fields
public const int MaximumDataValidationFormulaLength #Maximum character count supported by an Excel data-validation formula.
255Extension Methods
public static ExcelChart AddContributionChart(ExcelSheet sheet, string dataRangeA1, int row, int column, string title = "Contribution", OfficeLength? width = null, OfficeLength? height = null, bool hasHeaders = true, bool includeCachedData = true) #Adds a doughnut chart with category/percent labels for contribution and mix analysis.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- dataRangeA1 string
- row int
- column int
- title string = "Contribution"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- hasHeaders bool = true
- includeCachedData bool = true
Returns
ExcelChartpublic static ExcelDashboardResult AddDashboard(ExcelSheet sheet, DataTable data, ExcelDashboardOptions? options = null) #Builds a dashboard table and optional chart from a data table.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- Worksheet that receives the dashboard.
- data System.Data.DataTable
- Tabular data to write.
- options OfficeIMO.Excel.Reports.ExcelDashboardOptions? = null
- Dashboard layout and styling options.
public static ExcelChart AddDashboardChart(ExcelSheet sheet, ExcelDashboardChartOptions options) #Adds a dashboard-ready chart from a range or table and applies preset styling.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- Worksheet that receives the chart.
- options OfficeIMO.Excel.Reports.ExcelDashboardChartOptions
- Dashboard chart options.
public static ExcelChart AddKpiScorecardChart(ExcelSheet sheet, string dataRangeA1, int row, int column, string title = "KPI Scorecard", OfficeLength? width = null, OfficeLength? height = null, bool hasHeaders = true, bool includeCachedData = true) #Adds a compact column chart with value callouts and dashboard-friendly defaults for KPI scorecards.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- dataRangeA1 string
- row int
- column int
- title string = "KPI Scorecard"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- hasHeaders bool = true
- includeCachedData bool = true
Returns
ExcelChartpublic static ExcelChart AddRevenueTrendChart(ExcelSheet sheet, string dataRangeA1, int row, int column, string title = "Revenue Trend", OfficeLength? width = null, OfficeLength? height = null, bool hasHeaders = true, bool includeCachedData = true) #Adds a line chart with dashboard-friendly defaults for time-series revenue or volume trends.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- dataRangeA1 string
- row int
- column int
- title string = "Revenue Trend"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- hasHeaders bool = true
- includeCachedData bool = true
Returns
ExcelChartpublic static ExcelChart AddStatusBreakdownChart(ExcelSheet sheet, string dataRangeA1, int row, int column, string title = "Status Breakdown", OfficeLength? width = null, OfficeLength? height = null, bool hasHeaders = true, bool includeCachedData = true) #Adds a doughnut chart with dashboard-friendly defaults for status, category, or allocation breakdowns.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- dataRangeA1 string
- row int
- column int
- title string = "Status Breakdown"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- hasHeaders bool = true
- includeCachedData bool = true
Returns
ExcelChartpublic static ExcelSubtotalResult AddSubtotalSummary(ExcelSheet sheet, ExcelSubtotalOptions options) #Creates a grouped subtotal summary block from a contiguous worksheet data range.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- Worksheet that holds the data.
- options OfficeIMO.Excel.Reports.ExcelSubtotalOptions
- Subtotal generation options.
public static ExcelChart AddTopNBarChart(ExcelSheet sheet, string dataRangeA1, int row, int column, string title = "Top Items", OfficeLength? width = null, OfficeLength? height = null, bool hasHeaders = true, bool includeCachedData = true) #Adds a horizontal bar chart with dashboard-friendly defaults for top-N rankings.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- dataRangeA1 string
- row int
- column int
- title string = "Top Items"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- hasHeaders bool = true
- includeCachedData bool = true
Returns
ExcelChartpublic static ExcelChart AddVarianceColumnChart(ExcelSheet sheet, string dataRangeA1, int row, int column, string title = "Variance", OfficeLength? width = null, OfficeLength? height = null, bool hasHeaders = true, bool includeCachedData = true) #Adds a clustered column chart with dashboard-friendly defaults for variance comparisons.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- dataRangeA1 string
- row int
- column int
- title string = "Variance"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- hasHeaders bool = true
- includeCachedData bool = true
Returns
ExcelChartpublic static ExcelChart AddVarianceWaterfallChart(ExcelSheet sheet, string dataRangeA1, int row, int column, string title = "Variance Bridge", OfficeLength? width = null, OfficeLength? height = null, bool hasHeaders = true, bool includeCachedData = true) #Adds a waterfall-style stacked column chart for variance bridges prepared with helper series.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- dataRangeA1 string
- row int
- column int
- title string = "Variance Bridge"
- width OfficeIMO.OfficeLength? = null
- height OfficeIMO.OfficeLength? = null
- hasHeaders bool = true
- includeCachedData bool = true
Returns
ExcelChart