ExcelDocumentScope
OfficeIMO.Excel
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.
Returned or exposed by 18
- Method ExcelDocumentScope.ActiveWorksheet
- Method ExcelDocumentScope.ApplicationProperties
- Method ExcelDocumentScope.Calculation
- Method ExcelDocumentScope.Configure
- Method ExcelDocumentScope.CustomProperties
- Method ExcelDocumentScope.DateSystem
- Method ExcelDocumentScope.DateTimeOffsetWriteMode
- Method ExcelDocumentScope.DefaultChartStylePreset
- Method ExcelDocumentScope.Execution
- Method ExcelDocumentScope.Properties
- Method ExcelDocumentScope.Sheet
- Method ExcelDocumentScope.SheetCachingEnabled
- Method ExcelDocumentScope.TableNameComparer
- Method ExcelDocumentScope.TableOfContents
- Method ExcelDocumentScope.VbaProject
- Method ExcelDocumentScope.WorkbookThemeName
- Method ExcelDocumentScope.WorkbookThemeXml
- Method ExcelDocumentScope.WriteReservation
Accepted by parameters 1
- Method ExcelDocument.Create
Methods
public ExcelDocumentScope ActiveWorksheet(string sheetName) #Sets the worksheet that spreadsheet applications should show when the workbook opens.
Parameters
- sheetName string
- Worksheet name.
public ExcelDocumentScope ActiveWorksheet(int sheetIndex) #Sets the worksheet that spreadsheet applications should show when the workbook opens.
Parameters
- sheetIndex int
- Zero-based worksheet index.
public ExcelDocumentScope ActiveWorksheet(ExcelSheet sheet) #Sets the worksheet that spreadsheet applications should show when the workbook opens.
Parameters
- sheet OfficeIMO.Excel.ExcelSheet
- Worksheet to activate.
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>
- Configures the value.
public ExcelDocumentScope ApplicationProperties(Action<ExcelApplicationProperties> configure) #Configures ExcelDocument.ApplicationProperties in place: Extended (application) properties (Company, Manager, etc.).
Parameters
- configure System.Action<OfficeIMO.Excel.ExcelApplicationProperties>
- Configures the value.
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>
- Configures the value.
public ExcelDocumentScope Configure(Action<ExcelDocument> configure) #Assigns callbacks and related configuration without invoking delegate-valued properties.
Parameters
- configure System.Action<OfficeIMO.Excel.ExcelDocument>
- Assignments applied in order.
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>
- Configures the value.
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
- The value.
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
- The value.
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?
- The value.
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>
- Configures the value.
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>
- Configures the value.
public ExcelDocumentScope Sheet(string worksheetName = "", Action<ExcelSheetScope>? configure = null) #Adds a worksheet to the document.
Parameters
- worksheetName string = ""
- Worksheet name.
- configure System.Action<OfficeIMO.Excel.ExcelSheetScope>? = null
- Configures the new item through its 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
- Requested worksheet name.
- validationMode OfficeIMO.Excel.ExcelSheetNameValidationMode
- How to validate the sheet name: None (no checks), Sanitize (coerce), or Strict (throw on invalid).
- configure System.Action<OfficeIMO.Excel.ExcelSheetScope>? = null
- Configures the new item through its 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
- The value; true when omitted.
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>
- The value.
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"
- TOC sheet name.
- placeFirst bool = true
- Move TOC as the first sheet.
- withHyperlinks bool = true
- Create internal hyperlinks.
- includeNamedRanges bool = false
- Also list defined names in a dedicated column.
- includeHiddenNamedRanges bool = false
- When listing defined names, include ones marked Hidden.
- rangeNameFilter System.Predicate<string>? = null
- Optional filter to include only matching defined names.
- styled bool = true
- When true, renders a banner and a formatted table with AutoFilter.
- configure System.Action<OfficeIMO.Excel.ExcelSheetScope>? = null
- Configures the new item through its 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
- The value.
- options OfficeIMO.OfficeVbaWriteOptions? = null
- The value.
public ExcelDocumentScope WorkbookThemeName(string name) #Sets the workbook theme name while preserving the rest of the theme XML.
Parameters
- name string
- The value.
public ExcelDocumentScope WorkbookThemeXml(string themeXml) #Replaces or creates the workbook theme part with caller-supplied DrawingML theme XML.
Parameters
- themeXml string
- The value.
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
- The value.
Inherited Methods
Properties
public ExcelDocument Model { get; } #The ExcelDocument this scope edits, for plain C# inside a lambda.