Click or drag to resize
PicoXLSX

Workbook Class

Class representing a workbook
Inheritance Hierarchy
SystemObject
  PicoXLSXWorkbook

Namespace: PicoXLSX
Assembly: PicoXLSX (in PicoXLSX.dll) Version: 3.2.1+e0edc719a6aeecf6c989e5a57750c75d6f3175bb
Syntax
C#
public class Workbook

The Workbook type exposes the following members.

Constructors
 NameDescription
Public methodWorkbook Initializes a new instance of the Workbook class
Public methodWorkbook(Boolean) Initializes a new instance of the Workbook class
Public methodWorkbook(String) Initializes a new instance of the Workbook class
Public methodWorkbook(String, String) Initializes a new instance of the Workbook class
Public methodWorkbook(String, String, Boolean) Initializes a new instance of the Workbook class
Top
Properties
 NameDescription
Public propertyCurrentWorksheet Gets the current worksheet
Public propertyFilename Gets or sets the filename of the workbook
Public propertyHidden Gets or sets a value indicating whether Hidden Gets or sets whether the whole workbook is hidden
Public propertyLockStructureIfProtected Gets a value indicating whether LockStructureIfProtected Gets whether the structure are locked if workbook is protected. See also SetWorkbookProtection(Boolean, Boolean, Boolean, String)
Public propertyLockWindowsIfProtected Gets a value indicating whether LockWindowsIfProtected Gets whether the windows are locked if workbook is protected. See also SetWorkbookProtection(Boolean, Boolean, Boolean, String)
Public propertySelectedWorksheet Gets the selected worksheet. The selected worksheet is not the current worksheet while design time but the selected sheet in the output file
Public propertyUseWorkbookProtection Gets or sets a value indicating whether UseWorkbookProtection Gets or sets whether the workbook is protected
Public propertyWorkbookMetadata Gets or sets the WorkbookMetadata Meta data object of the workbook
Public propertyWorkbookProtectionPassword Gets the password used for workbook protection. See also SetWorkbookProtection(Boolean, Boolean, Boolean, String)
Public propertyWorkbookProtectionPasswordHash Gets or sets the WorkbookProtectionPasswordHash Hash of the protected workbook, originated from WorkbookProtectionPassword
Public propertyWorksheets Gets the list of worksheets in the workbook
Public propertyWS Gets the shortener object for the current worksheet
Top
Methods
 NameDescription
Public methodAddMruColor Adds a color value (HEX; 6-digit RGB or 8-digit ARGB) to the MRU list
Public methodAddStyleObsolete.
Adds a style to the style repository. This method is deprecated since it has no direct impact on the generated file
Public methodAddStyleComponentObsolete.
Adds a style component to a style. This method is deprecated since it has no direct impact on the generated file
Public methodAddWorksheet(String) Adding a new Worksheet. The new worksheet will be defined as current worksheet
Public methodAddWorksheet(Worksheet) Adding a new Worksheet. The new worksheet will be defined as current worksheet
Public methodAddWorksheet(String, Boolean) Adding a new Worksheet with a sanitizing option. The new worksheet will be defined as current worksheet
Public methodAddWorksheet(Worksheet, Boolean) Adding a new Worksheet. The new worksheet will be defined as current worksheet
Public methodClearMruColors Clears the MRU color list
Public methodCopyWorksheetIntoThis(Int32, String, Boolean) Copies a worksheet of the current workbook by its index
Public methodCopyWorksheetIntoThis(String, String, Boolean) Copies a worksheet of the current workbook by its name
Public methodCopyWorksheetIntoThis(Worksheet, String, Boolean) Copies a worksheet of any workbook into the current workbook
Public methodCopyWorksheetTo(Int32, String, Workbook, Boolean) Copies a worksheet of the current workbook by its index into another workbook
Public methodCopyWorksheetTo(String, String, Workbook, Boolean) Copies a worksheet of the current workbook by its name into another workbook
Public methodStatic memberCopyWorksheetTo(Worksheet, String, Workbook, Boolean) Copies a worksheet of any workbook into the another workbook
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetMruColors Gets the MRU color list
Private methodGetNextWorksheetId Gets the next free worksheet ID
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetWorksheet(Int32) Gets a worksheet from this workbook by index
Public methodGetWorksheet(String) Gets a worksheet from this workbook by name
Private methodInit Init method called in the constructors
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodRemoveStyle(String)Obsolete.
Removes the defined style from the style sheet of the workbook. This method is deprecated since it has no direct impact on the generated file
Public methodRemoveStyle(Style)Obsolete.
Removes the passed style from the style sheet. This method is deprecated since it has no direct impact on the generated file
Public methodRemoveStyle(String, Boolean)Obsolete.
Removes the defined style from the style sheet of the workbook. This method is deprecated since it has no direct impact on the generated file
Public methodRemoveStyle(Style, Boolean)Obsolete.
Removes the defined style from the style sheet of the workbook
Public methodRemoveWorksheet(Int32) Removes the defined worksheet based on its index. If the worksheet is the current or selected worksheet, the current and / or the selected worksheet will be set to the last worksheet of the workbook Removes the defined worksheet based on its index. If the worksheet is the current or selected worksheet, the current and / or the selected worksheet will be set to the last worksheet of the workbook
Public methodRemoveWorksheet(String) Removes the defined worksheet based on its name. If the worksheet is the current or selected worksheet, the current and / or the selected worksheet will be set to the last worksheet of the workbook Removes the defined worksheet based on its name. If the worksheet is the current or selected worksheet, the current and / or the selected worksheet will be set to the last worksheet of the workbook
Private methodRemoveWorksheet(Int32, Boolean) Removes the worksheet at the defined index and relocates current and selected worksheet references
Protected methodResolveMergedCells Method to resolve all merged cells in all worksheets. Only the value of the very first cell of the locked cells range will be visible. The other values are still present (set to EMPTY) but will not be stored in the worksheet.
This is an internal method. There is no need to use it
Public methodSave Saves the workbook
Public methodSaveAs Saves the workbook with the defined name
Public methodSaveAsAsync Saves the workbook with the defined name asynchronous
Public methodSaveAsStream Save the workbook to a writable stream
Public methodSaveAsStreamAsync Save the workbook to a writable stream asynchronous
Public methodSaveAsync Saves the workbook asynchronous
Public methodSetCurrentWorksheet(Int32) Sets the current worksheet
Public methodSetCurrentWorksheet(String) Sets the current worksheet
Public methodSetCurrentWorksheet(Worksheet) Sets the current worksheet
Public methodSetSelectedWorksheet(Int32) Sets the selected worksheet in the output workbook
Public methodSetSelectedWorksheet(String) Sets the selected worksheet in the output workbook
Public methodSetSelectedWorksheet(Worksheet) Sets the selected worksheet in the output workbook
Public methodSetWorkbookProtection Sets or removes the workbook protection. If protectWindows and protectStructure are both false, the workbook will not be protected
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Protected methodValidateWorksheets Validates the worksheets regarding several conditions that must be met:
- At least one worksheet must be defined
- A hidden worksheet cannot be the selected one
- At least one worksheet must be visible
If one of the conditions is not met, an exception is thrown
Top
See Also