Message-ID: <284313233.8875.1711666059819.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8874_1652762854.1711666059819" ------=_Part_8874_1652762854.1711666059819 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Workbook

Workbook

Description

A=20 Workbook object represents an Excel = workbook. To return a=20 Workbook object: Call=20 ExcelApplication.Create() to create = a new Excel workbook. Call=20 ExcelApplication.Open()= to open an existing Excel workbook.=20
C#
=20
[DefaultMember("Item")]
 public sealed class Workbook : System.Collections.Generic.IEnumerable<W=
orksheet>
=20
=20
vb.net
=20
<DefaultMember("Item")> _
=09Public NotInheritable Class Workbook
=09=09Implements System.Collections.Generic.IEnumerable(Of Worksheet)
=20
=20

Examples

=20
C#
=20
          //--- Create a new Workbook
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();

          //--- Open an existing Workbook
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Open(@"C:\Reports\Report.xls");
        
=20
vb.net
=20
          '--- Create a new Workbook
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()

          '--- Open an existing Workbook
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Open("C:\Reports\Report.xls"=
)
        
=20

Properties

Name

Description

DisplayTabs

Shows or hides the worksheet tabs at the bottom = of the workbook window.

DocumentProperties

Returns a DocumentProperties object that represents properties of the spec= ified workbook, such as name, author, and summary. In Microsoft Excel, thes= e properties are displayed in the file's Properties sheet. To view the Prop= erties sheet in Excel, open Excel's File menu, and select Properties.

EncryptPassword

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 Exc= el 97 and later versions.

ExcludeMacros

Sets or returns whether ExcelWriter should remov= e macros from the generated workbook or leave them in when saved.

FirstDisplayedTab

Sets or returns the first worksheet tab to displ= ay in the tab bar at the bottom of the workbook window.

Hei= ght

Sets or returns the height of the workbook's win= dow

HorizontalPosition

Sets or returns the horizontal (x) position of t= he workbook window's upper left corner when displayed in Excel.

IsProtected

Returns whether or not the worksheet is protecte= d.

NamedRanges

Returns the named ranges of the Workbook as an array of NamedObject objects as an IEnumerable collection. Though the named ranges are not retu= rned in any particular order, they are iterable.

NumberFormat

Returns the NumberFormat used for formatting of numbers and dates.

Pa= lette

Returns a Palette object that represents the specified workbook's color pale= tte.

PasswordToModify

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 s= upplies a matching password when opening the spreadsheet.

ProtectPasswordHash

Sets or returns the password hash that is used t= o protect the workbook.

R= eadOnly

Determines whether the workbook can only be open= ed in read-only mode.

ReadOnlyRecommended

Sets or returns whether Excel will recommend - w= hen the workbook is opened - that it be viewed in read-only mode.

ShowHorizontalScrollBar

When true, the horizontal scroll bar will be sho= wn in the generated workbook. When false, the horizontal scroll bar will be= hidden.

ShowVerticalScrollBar

Shows or hides the vertical scroll bar in the ge= nerated workbook.

T= abRatio

Sets or returns the ratio between the workbook's= tab bar and the horizontal scroll bar.

UseRCFormulaNotation

Indicates or sets the type of references used in= this workbook.

VerticalPosition

Sets or returns the vertical (y) position of the= workbook window's upper left corner when displayed in Excel.

Widt= h

Sets or returns the width of the workbook's wind= ow.

Worksheets

Returns a W= orksheets collection which provides access to all worksheets in the spe= cified workbook, including charts displayed as sheets.

Indexers

Name

Description

Item(Int32)

Returns the worksheet specified by a 0-based ind= ex. This property is an indexer for the = Workbook class.

Item(String)

Returns the worksheet with the specified name. T= his property is an indexer for the Workb= ook class.

Methods

Name

Description

CreateConditionalFormat()

Creates a new ConditionalFormat object that can be set on Cells, Areas and Ranges.

CreateCopyPasteProperties(CopyPasteType)

Creates a CopyPasteProperties object with the specified data type propert= ies set.

CreateDataImportProperties()

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.

CreateDataValidation(ValidationType, Object)

Creates a DataValidation object which can be set on a Range, Area, or Cell.

CreateDataValidation(ValidationType, String)

Creates a DataValidation object which can be set on a Range, Area, or Cell.

CreateNamedRange(Area(), String)

Creates a Range<= /a> of cells from an array of Areas. A Range is a collection o= f Area s; an Area area is a= rectangular collection of cells.

CreateNamedRange(String, String)

Creates a named = Range of cells from a specified formula. A Range is a coll= ection of Area s; an Area a= rea is a rectangular collection of cells.

CreateNamedStyle(String)

Creates a named global style, which can be bound= to cells, areas, ranges, rows, and columns. Any later changes to this styl= e will affect all cells to which the style was assigned.

CreateRange(String)

Creates a Range<= /a> of cells from a specified formula. A Range is a collection= of Area s; an Area area is= a rectangular collection of cells.

CreateRange(Area())

Creates a Range<= /a> of cells from an array of Areas. A Range is a collection o= f Area s; an Area area is a= rectangular collection of cells.

CreateStyle()

Creates a global style, which can be bound to ce= lls, areas, ranges, rows, and columns. Any later changes to this style will= affect all cells to which the style was bound.

GetEnumerator()

Returns an IEnumerator for the Worksheets in= a Workbook

GetNamedObject(String)

Returns the NamedObject object that represents the name of a specified array, num= ber, picture, or range. If the named object does not exist, the method retu= rns null.

GetNamedRange(String)

Returns the specified named Range. If the named range does not exist, the method return= s null.

GetNamedStyle(String)

Returns a N= amedStyle if it exists. If the style does not exist, null is returned.<= /td>

GetTextHeight(String, Font, Double)

Returns the minimum height required to fit the g= iven text string using the given font.

GetTextWidth(String, Font, Double)

Returns the minimum width required to fit the gi= ven text string using the given font.

Protect(String)

Protects the workbook structure using the suppli= ed password. End users will not be able to add or remove worksheets unless = they enter the password.
RemoveFormulas() The RemoveFormulas method removes = Excel formulas from the entire workbook, while leaving their values in cell= s. This method does NOT remove Conditional Formatting or Data Validation.

Unprotect()

Removes protection from the workbook.
------=_Part_8874_1652762854.1711666059819--