IWorkbook Properties |
The IWorkbook type exposes the following members.
Name | Description | |
---|---|---|
![]() |
ActiveSheet |
Returns an object that represents the active sheet (the sheet on top)
in the active workbook or in the specified window or workbook. Returns
Nothing if no sheet is active. Read-only.
|
![]() |
ActiveSheetIndex |
Gets / sets index of the active sheet.
|
![]() |
AddInFunctions |
Returns collection of all workbook's add-in functions. Read-only.
|
![]() |
Allow3DRangesInDataValidation |
Indicates whether to allow usage of 3D ranges in DataValidation
list property (MS Excel doesn't allow).
|
![]() |
ArgumentsSeparator |
Formula arguments separator.
|
![]() |
Author |
Returns or sets the author of the comment. Read-only String.
|
![]() ![]() |
BuiltInDocumentProperties |
Returns collection that represents all the built-in document properties
for the specified workbook. Read-only.
![]()
The following code snippet illustrates how to get the built in document properties:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Get the built in document properties</para><para>IBuiltInDocumentProperties builtInDocumentProperties = workbook.DocumentProperties;</para>
|
![]() |
Charts |
Collection of the chart objects.
|
![]() |
CodeName |
Name which is used by macros to access the workbook items.
|
![]() ![]() |
CustomDocumentProperties |
Returns collection that represents all the custom document properties
for the specified workbook. Read-only.
![]()
The following code snippet illustrates how to get the custom document properties:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Get the document properties</para><para>ICustomDocumentProperties documentProperties = workbook.CustomDocumentProperties;</para>
|
![]() |
Date1904 |
True if the workbook uses the 1904 date system. Read / write Boolean.
|
![]() |
DetectDateTimeInValue |
Indicates whether library should try to detect string value passed to Value (and Value2)
property as DateTime. Setting this property to false can increase performance greatly for
such operations especially on Framework 1.0 and 1.1. Default value is true.
|
![]() |
DisableMacrosStart |
This Property allows users to disable load of macros from
document. Excel on file open will simply skip macros and will
work as if document does not contain them. This options works
only when file contains macros (HasMacros property is True).
|
![]() |
DisplayedTab |
Index of tab which will be displayed on document open.
|
![]() |
DisplayWorkbookTabs |
Indicates whether tabs are visible.
|
![]() |
HasMacros |
True indicate that opened workbook contains VBA macros.
|
![]() |
IsCellProtection |
True if cell is protected.
|
![]() |
IsDisplayPrecision |
True if cell is protected.
|
![]() ![]() |
IsHScrollBarVisible |
Gets or sets a value indicating whether to display horizontal scroll bar.
![]()
This sample shows how to hide horizontal scroll bar:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>//Hide horizontal scroll bar</para><para>workbook.IsHScrollBarVisible = false;</para><para>//Save to file</para><para>workbook.SaveToFile("IsHScrollBarVisible.xlsx");</para>
|
![]() |
IsRightToLeft |
Indicates whether worksheet is displayed right to left.
|
![]() ![]() |
IsVScrollBarVisible |
Gets or sets a value indicating whether to display vertical scroll bar.
![]()
This sample shows how to hide vertical scroll bar:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>//Hide vertical scroll bar</para><para>workbook.IsVScrollBarVisible = false;</para><para>//Save to file</para><para>workbook.SaveToFile("IsVScrollBarVisible.xlsx");</para>
|
![]() |
IsWindowProtection |
True if window is protected.
|
![]() |
MaxColumnCount |
Returns maximum column count for each worksheet in this workbook. Read-only.
|
![]() |
MaxRowCount |
Returns maximum row count for each worksheet in this workbook. Read-only.
|
![]() ![]() |
Names |
For an ReservedHandle object, returns a Names collection that represents
all the names in the active workbook. For a Workbook object, returns
a Names collection that represents all the names in the specified
workbook (including all worksheet-specific names).
![]()
The following code snippet illustrates how to get names:
<para>//Create workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Get names</para><para>INameRanges names = workbook.NameRanges;</para>
|
![]() ![]() |
Palette |
Get Palette of colors which an Excel document can have.
Here is a table of color indexes to places in the color tool box
provided by Excel application:
--------------------------------------------
|| 1| 2| 3| 4| 5| 6| 7| 8|
---+----------------------------------------
|1 | 00 | 51 | 50 | 49 | 47 | 10 | 53 | 54 |
|2 | 08 | 45 | 11 | 09 | 13 | 04 | 46 | 15 |
|3 | 02 | 44 | 42 | 48 | 41 | 40 | 12 | 55 |
|4 | 06 | 43 | 05 | 03 | 07 | 32 | 52 | 14 |
|5 | 37 | 39 | 35 | 34 | 33 | 36 | 38 | 01 |
---+----------------------------------------
|6 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
|7 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
--------------------------------------------
![]()
The following code illustrates how to access the default colors of excel color palette:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Get colors</para><para>System.Drawing.Color[] colors = workbook.Colors;</para><para>//Get color</para><para>System.Drawing.Color color = colors[2];</para><para>//Set color</para><para>worksheet["B2"].Style.Color = color;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() |
Parent |
Gets the parent object of the current instance.
(Inherited from
IExcelApplication
.)
|
![]() |
PasswordToOpen |
Gets / sets password to encrypt document.
|
![]() ![]() |
PivotCaches |
Returns pivot caches collection. Read-only.
![]()
The following code snippet illustrates how to get pivot caches:
<para>//Load workbook</para><para>Workbook workbook = new Workbook();</para><para>workbook.LoadFromFile("Sample.xlsx");</para><para>//Gets pivot caches collection</para><para>IPivotCaches pivotCaches = workbook.PivotCaches;</para>
|
![]() |
ReadOnly |
True if the workbook has been opened as Read-only. Read-only Boolean.
|
![]() |
ReadOnlyRecommended |
True to display a message when the file is opened, recommending that the file be opened as read-only.
|
![]() |
RowSeparator |
Gets / sets row separator for array parsing.
|
![]() |
Saved |
True if no changes have been made to the specified workbook since
it was last saved. Read/write Boolean.
|
![]() ![]() |
StandardFont |
Returns or sets the name of the standard font. Read/write String.
![]()
The following code illustrates how to set the standard font for the workbook:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["B2"].Text = "Text";</para><para>//Set standard font</para><para>workbook.DefaultFontName = "Arial";</para><para>//Set standard font size</para><para>workbook.DefaultFontSize = 18;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() ![]() |
StandardFontSize |
Returns or sets the standard font size, in points. Read/write.
![]()
The following code illustrates how to set the standard font size for the workbook:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set text</para><para>worksheet["B2"].Text = "Text";</para><para>//Set standard font</para><para>workbook.DefaultFontName = "Arial";</para><para>//Set standard font size</para><para>workbook.DefaultFontSize = 18;</para><para>//Save to file</para><para>workbook.SaveToFile("CellFormats.xlsx");</para>
|
![]() ![]() |
Styles |
Returns a Styles collection that represents all the styles
in the specified workbook. Read-only.
![]()
The following code snippet illustrates how to get the Styles:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set styles</para><para>IStyles styles = workbook.Styles;</para>
|
![]() |
TabSheets |
Returns collection of tab sheets. Read-only.
|
![]() |
ThrowOnUnknownNames |
Indicates whether exception should be thrown when unknown
name was found in a formula.
|
![]() |
Version |
Gets / sets excel version.
|
![]() |
Worksheets |
Returns a Sheets collection that represents all the worksheets
in the specified workbook. Read-only Sheets object.
|