Description
A Workbook object represents an Excel workbook. To return a Workbook
object: Call ExcelApplication.Create() to create a new Excel workbook. Call ExcelApplication.Open() to open an existing Excel workbook.
C#
vb.net
Examples
C#
vb.net
Properties
Name |
Description |
---|---|
Shows or hides the worksheet tabs at the bottom of the workbook window. | |
Returns a DocumentProperties object that represents properties of the specified workbook, such as name, author, and summary. In Microsoft Excel, these properties are displayed in the file's Properties sheet. To view the Properties sheet in Excel, open Excel's File menu, and select Properties. | |
Sets or returns the password used to encrypt the spreadsheet. Standard "Office 97/2000 Compatible" encryption is used to encrypt the spreadsheet. This is the default encryption used by Excel 97 and later versions. | |
Sets or returns whether ExcelWriter should remove macros from the generated workbook or leave them in when saved. | |
Sets or returns the first worksheet tab to display in the tab bar at the bottom of the workbook window. | |
Sets or returns the height of the workbook's window | |
Sets or returns the horizontal (x) position of the workbook window's upper left corner when displayed in Excel. | |
Returns whether or not the worksheet is protected. | |
Returns the named ranges of the Workbook as an array of NamedObject objects as an IEnumerable collection. Though the named ranges are not returned in any particular order, they are iterable. | |
Returns the NumberFormat used for formatting of numbers and dates. | |
Returns a Palette object that represents the specified workbook's color palette. | |
This sets the workbook so that it can be opened in read-only mode with the option to open in read-write mode, if the user supplies a matching password when opening the spreadsheet. | |
Sets or returns the password hash that is used to protect the workbook. | |
Determines whether the workbook can only be opened in read-only mode. | |
Sets or returns whether Excel will recommend - when the workbook is opened - that it be viewed in read-only mode. | |
When true, the horizontal scroll bar will be shown in the generated workbook. When false, the horizontal scroll bar will be hidden. | |
Shows or hides the vertical scroll bar in the generated workbook. | |
Sets or returns the ratio between the workbook's tab bar and the horizontal scroll bar. | |
Indicates or sets the type of references used in this workbook. | |
Sets or returns the vertical (y) position of the workbook window's upper left corner when displayed in Excel. | |
Sets or returns the width of the workbook's window. | |
Returns a Worksheets collection which provides access to all worksheets in the specified workbook, including charts displayed as sheets. |
Indexers
Name |
Description |
---|---|
Returns the worksheet specified by a 0-based index. This property is an indexer for the Workbook class. | |
Returns the worksheet with the specified name. This property is an indexer for the Workbook class. |
Methods
Name |
Description |
---|---|
Creates a new ConditionalFormat object that can be set on Cells, Areas and Ranges. | |
Creates a CopyPasteProperties object with the specified data type properties set. | |
Creates a DataImportProperties object that contains a set of properties that can be used when importing data to a Worksheet or Area. | |
CreateDataValidation(ValidationType, ComparisonType, Object) |
Creates a DataValidation object which can be set on a Range, Area, or Cell. |
CreateDataValidation(ValidationType, ComparisonType, Object, Object) |
Creates a DataValidation object which can be set on a Range, Area, or Cell. |
CreateDataValidation(ValidationType, ComparisonType, String) |
Creates a DataValidation object which can be set on a Range, Area, or Cell. |
CreateDataValidation(ValidationType, ComparisonType, String, String) |
Creates a DataValidation object which can be set on a Range, Area, or Cell. |
Creates a DataValidation object which can be set on a Range, Area, or Cell. | |
Creates a DataValidation object which can be set on a Range, Area, or Cell. | |
Creates a Range of cells from an array of Areas. A Range is a collection of Area s; an Area area is a rectangular collection of cells. |
|
Creates a named Range of cells from a specified formula. A Range is a collection of Area s; an Area area is a rectangular collection of cells. |
|
Creates a named global style, which can be bound to cells, areas, ranges, rows, and columns. Any later changes to this style will affect all cells to which the style was assigned. | |
Creates a Range of cells from a specified formula. A Range is a collection of Area s; an Area area is a rectangular collection of cells. |
|
Creates a Range of cells from an array of Areas. A Range is a collection of Area s; an Area area is a rectangular collection of cells. |
|
Creates a global style, which can be bound to cells, areas, ranges, rows, and columns. Any later changes to this style will affect all cells to which the style was bound. | |
Returns an IEnumerator for the Worksheets in a Workbook |
|
Returns the NamedObject object that represents the name of a specified array, number, picture, or range. If the named object does not exist, the method returns null. | |
Returns the specified named Range. If the named range does not exist, the method returns null. | |
Returns a NamedStyle if it exists. If the style does not exist, null is returned. | |
Returns the minimum height required to fit the given text string using the given font. | |
Returns the minimum width required to fit the given text string using the given font. | |
Protects the workbook structure using the supplied password. End users will not be able to add or remove worksheets unless they enter the password. | |
Removes protection from the workbook. |