Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ExcelDocumentScope

OfficeIMO.Excel

Namespace
OfficeIMO.Excel
Assembly
OfficeIMO.Excel
Modifiers
sealed

Edits one ExcelDocument: its fluent methods and keywords, each returning this scope.

Inheritance

  • object
  • ExcelDocumentScope

Usage

Explore 19 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.

Accepted by parameters 1

Methods

ActiveWorksheet 4 overloads
public ExcelDocumentScope ActiveWorksheet(string sheetName) #

Sets the worksheet that spreadsheet applications should show when the workbook opens.

Parameters

sheetName string required
Worksheet name.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope ActiveWorksheet(int sheetIndex) #

Sets the worksheet that spreadsheet applications should show when the workbook opens.

Parameters

sheetIndex int required
Zero-based worksheet index.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope ActiveWorksheet(ExcelSheet sheet) #

Sets the worksheet that spreadsheet applications should show when the workbook opens.

Parameters

sheet OfficeIMO.Excel.ExcelSheet required
Worksheet to activate.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope ActiveWorksheet(Action<ExcelSheet> configure) #

Configures ExcelDocument.ActiveWorksheet in place: Gets the worksheet that spreadsheet applications show when the workbook opens, or null when the active tab is not a worksheet.

Parameters

configure System.Action<OfficeIMO.Excel.ExcelSheet> required
Configures the value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope ApplicationProperties(Action<ExcelApplicationProperties> configure) #

Configures ExcelDocument.ApplicationProperties in place: Extended (application) properties (Company, Manager, etc.).

Parameters

configure System.Action<OfficeIMO.Excel.ExcelApplicationProperties> required
Configures the value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope Calculation(Action<ExcelCalculationOptions> configure) #

Configures ExcelDocument.Calculation in place: Formula calculation and cached-result policy used during save.

Parameters

configure System.Action<OfficeIMO.Excel.ExcelCalculationOptions> required
Configures the value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope Configure(Action<ExcelDocument> configure) #

Assigns callbacks and related configuration without invoking delegate-valued properties.

Parameters

configure System.Action<OfficeIMO.Excel.ExcelDocument> required
Assignments applied in order.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope CustomProperties(Action<ExcelCustomDocumentPropertyCollection> configure) #

Configures ExcelDocument.CustomProperties in place: Custom workbook properties keyed by property name.

Parameters

configure System.Action<OfficeIMO.Excel.ExcelCustomDocumentPropertyCollection> required
Configures the value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope DateSystem(ExcelDateSystem value) #

Sets ExcelDocument.DateSystem: Gets or sets the workbook date system used for serialized date values.

Parameters

value OfficeIMO.Excel.ExcelDateSystem required
The value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope DateTimeOffsetWriteMode(ExcelDateTimeOffsetWriteMode value) #

Sets ExcelDocument.DateTimeOffsetWriteMode: Controls how DateTimeOffset values are written to worksheet cells. Defaults to ExcelDateTimeOffsetWriteMode.Text, which writes ISO 8601 text and keeps the offset. ExcelDateTimeOffsetWriteMode.Serial writes date serials converted by ExcelDocument.DateTimeOffsetWriteStrategy.

Parameters

value OfficeIMO.Excel.ExcelDateTimeOffsetWriteMode required
The value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope DefaultChartStylePreset(ExcelChartStylePreset? value) #

Sets ExcelDocument.DefaultChartStylePreset: Optional default chart style preset applied to charts created in this workbook.

Parameters

value OfficeIMO.Excel.ExcelChartStylePreset? required
The value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope Execution(Action<ExcelExecutionPolicy> configure) #

Configures ExcelDocument.Execution in place: Execution policy for controlling parallel vs sequential operations.

Parameters

configure System.Action<OfficeIMO.Excel.ExcelExecutionPolicy> required
Configures the value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope Properties(Action<ExcelBuiltinDocumentProperties> configure) #

Configures ExcelDocument.Properties in place: Built-in (core) document properties (Title, Creator, etc.).

Parameters

configure System.Action<OfficeIMO.Excel.ExcelBuiltinDocumentProperties> required
Configures the value.

Returns

ExcelDocumentScope The same scope.
Sheet 2 overloads
public ExcelDocumentScope Sheet(string worksheetName = "", Action<ExcelSheetScope>? configure = null) #

Adds a worksheet to the document.

Parameters

worksheetName string = "" optional
Worksheet name.
configure System.Action<OfficeIMO.Excel.ExcelSheetScope>? = null optional
Configures the new item through its scope.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope Sheet(string worksheetName, ExcelSheetNameValidationMode validationMode, Action<ExcelSheetScope>? configure = null) #

Adds a worksheet to the document with control over name validation.

Parameters

worksheetName string required
Requested worksheet name.
validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode required
How to validate the sheet name: None (no checks), Sanitize (coerce), or Strict (throw on invalid).
configure System.Action<OfficeIMO.Excel.ExcelSheetScope>? = null optional
Configures the new item through its scope.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope SheetCachingEnabled(bool value = true) #

Sets ExcelDocument.SheetCachingEnabled: Enables caching of ExcelSheet wrappers for faster repeat access at the cost of higher memory usage. Set to false to avoid holding references to every sheet in very large workbooks.

Parameters

value bool = true optional
The value; true when omitted.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope TableNameComparer(IEqualityComparer<string> value) #

Sets ExcelDocument.TableNameComparer: Controls how workbook-level table name uniqueness is compared. Defaults to StringComparer.OrdinalIgnoreCase. Changing this will reset the internal cache and rebuild it on next use. Set it once before adding tables for predictable behavior.

Parameters

value System.Collections.Generic.IEqualityComparer<string> required
The value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope TableOfContents(string sheetName = "TOC", bool placeFirst = true, bool withHyperlinks = true, bool includeNamedRanges = false, bool includeHiddenNamedRanges = false, Predicate<string>? rangeNameFilter = null, bool styled = true, Action<ExcelSheetScope>? configure = null) #

Adds or refreshes a visually styled Table of Contents sheet with hyperlinks.

Parameters

sheetName string = "TOC" optional
TOC sheet name.
placeFirst bool = true optional
Move TOC as the first sheet.
withHyperlinks bool = true optional
Create internal hyperlinks.
includeNamedRanges bool = false optional
Also list defined names in a dedicated column.
includeHiddenNamedRanges bool = false optional
When listing defined names, include ones marked Hidden.
rangeNameFilter System.Predicate<string>? = null optional
Optional filter to include only matching defined names.
styled bool = true optional
When true, renders a banner and a formatted table with AutoFilter.
configure System.Action<OfficeIMO.Excel.ExcelSheetScope>? = null optional
Configures the new item through its scope.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope VbaProject(OfficeVbaProject project, OfficeVbaWriteOptions? options = null) #

Applies a native source project, preserving unrelated payloads and requiring explicit VBA signature removal.

Parameters

project OfficeIMO.OfficeVbaProject required
The value.
options OfficeIMO.OfficeVbaWriteOptions? = null optional
The value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope WorkbookThemeName(string name) #

Sets the workbook theme name while preserving the rest of the theme XML.

Parameters

name string required
The value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope WorkbookThemeXml(string themeXml) #

Replaces or creates the workbook theme part with caller-supplied DrawingML theme XML.

Parameters

themeXml string required
The value.

Returns

ExcelDocumentScope The same scope.
public ExcelDocumentScope WriteReservation(ExcelWorkbookWriteReservationOptions? options = null) #

Writes workbook write-reservation metadata. This is not package encryption and does not protect worksheet or workbook structure.

Parameters

options OfficeIMO.Excel.ExcelWorkbookWriteReservationOptions? = null optional
The value.

Returns

ExcelDocumentScope The same scope.

Properties

public ExcelDocument Model { get; } #

The ExcelDocument this scope edits, for plain C# inside a lambda.