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

Worksheet

Description

The=20 Worksheet class represents a single Excel worksheet.=20
C#
=20
[DefaultMember("Item")]
 public class Worksheet
=20
=20
vb.net
=20
<DefaultMember("Item")> _
=09Public Class Worksheet
=20
=20

Remarks

To add a Worksheet to a Workbook,= call=20 Workbo= ok.Worksheets.CreateWorksheet(). To get an existing Worksheet call=20 Workbook.Workshee= ts[index or name].=20

Examples

=20
C#
=20
          //--- Create a new Worksheet
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Worksheet ws =3D wb.Worksheets.CreateWorksheet("Sheet2"=
);

          //--- Get an existing Worksheet by index
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Worksheet ws =3D wb.Worksheets[0];

          //--- Get an existing Worksheet by name
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Create();
          Worksheet ws =3D wb.Worksheets["Sheet1"];
=20
vb.net
=20
          '--- Create a new Worksheet
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets.CreateWorksheet("Sheet=
2")

          '--- Get an existing Worksheet by index
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets(0)

          '--- Get an existing Worksheet by name
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Create()
          Dim ws As Worksheet =3D wb.Worksheets("Sheet2")
        
=20

Properties

Name

Description

Cell= s

Returns a Cells collection that contains all cells in the worksheet.

Cha= rts

Returns a Charts= collection containing all the charts contained as objects within this = worksheet. Use this collection to add, access, and remove charts from the w= orksheet.

C= omments

Returns a Comm= ents collection that contains all comments in the worksheet.

FirstShownColumn

Sets or returns the 0-based index of the first c= olumn that is shown in the worksheet.

FirstShownRow

Sets or returns the 0-based index of the first r= ow that is shown in the worksheet.

FreezePanes

Freezes panes in a worksheet or returns the cell= at which the panes are split. Set the property to a Cell object. The cell specified in Worksheet.FreezePanes<= /code> is the first unfrozen cell; freeze panes will be applied to all rows= above the cell and all columns to the left of the cell.

GridlinesColor

Sets or returns a Color object representing the color of the gridlines in= the worksheet.

Hyperlinks

Returns the collection of hyperlinks in the work= sheet.

IsProtected

Returns whether or not the worksheet is write-pr= otected.

IsSelected

Returns whether this worksheet is selected.

Name<= /a>

Sets or returns the name of the worksheet. Sheet= names are limited to 255 characters and must not contain the following cha= racters: \ / ? [ ] : '

NamedRanges

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

= PageSetup

Returns a Pag= eSetup object representing page layout properties of a printed workshee= t.

P= ictures

Returns a Pict= ures collection containing all pictures in the worksheet. Use this coll= ection to add, access, and remove pictures from the worksheet.

PopulatedCells

Returns a rectanglular area of cells from the fi= rst (top, left) populated cell to the last (bottom, right) populated cell i= n the worksheet. The area returned will include cells that contain no data = but have been formatted.

P= osition

Returns the 0-based index of the worksheet in th= e collection of all sheets in the workbook.

ProtectPasswordHash

Sets or returns the password hash that is used t= o write-protect (not encrypt) the worksheet.

ShapeGroups

Returns a Groups= collection containing all shape groups within the worksheet.

Sha= pes

Returns a Shapes= collection containing all shapes within the worksheet.

SheetProtection

Returns a SheetProtection object containing all protection properties on = the worksheet.

ShowFormulas

Sets or returns whether formulas or their calcul= ated values will be displayed in the worksheet. Calculated values are displ= ayed by default.

ShowGridlines

Sets or returns whether gridlines should be show= n in the worksheet. Gridlines are shown by default.

ShowRowColHeaders

Sets or returns whether column and row headers w= ill be displayed in the worksheet. The headers are displayed by default.

ShowZeroValues

Sets or returns whether zero values in cells wil= l be displayed in the worksheet. Zero values are displayed by default.

StandardHeight

Sets or returns the default row height in points= (1/72 of an inch). This must be between 0 and 409.

StandardWidth

Sets or returns the default column width, in poi= nts (1/72 of an inch).

StandardWidthInChars

Sets or returns the default column width as a nu= mber of character widths in the 'Normal' font. This must be a value between= 0 and 255.

SummaryColumns

When grouping columns, SummaryColumns determines where the summary co= lumns for the groups are located. By default the summary rows are located t= o the right of the groupings.

SummaryRows

When grouping rows, SummaryRows determines where the summary rows for th= e groups are located. By default the summary rows are located below the gro= upings.

T= abColor

Sets or returns the color of the worksheet's she= et name tab. Setting the color to an automatic color will set the = ;color to no color.

W= orkbook

Returns the Workbook object in which this worksheet resides.

= ViewState

Sets or returns the worksheet's viewing mode.

Visibility

Sets or returns the visibility setting of the wo= rksheet.

ZoomPercentage

Sets or returns the percentage of standard size = by which the worksheet will be magnified or reduced. Set this property to a= value between 10 and 400.

Indexers

Name

Description

Item(Int32, Int32)

Returns the cell at a specified row and column p= osition. This property is an indexer for the Worksheet class.

Item(String)

Returns the cell at the specified Excel-style re= ference. This property is an indexer for the Worksheet class.

Methods

Name

Description

CopyPaste(Cell, Area)

Copies an area of cells from another Worksheet to cells in this worksheet.

CopyPaste(Cell, Area, CopyPasteProperties)

Copies an area of cells from another Worksheet to cells in this worksheet.

CopyPaste(Int32, Int32, Area)

Copies an area of cells from another Worksheet to cells in this worksheet.

CopyPaste(Int32, Int32, Area, CopyPasteProperties)

Copies an area of cells from a Worksheet in either the same workbook or another = workbook.
You may specify the types of data copied (cell value, formu= las, comments, formatting, etc.) using the CopyPasteProperties object.
The CopyPaste method sup= ports copying column width, comments, formulas, merged cells, row height, v= alues, and cell and number formatting.The CopyPaste method does not current= ly support copying anything not listed above, including charts, images, or = autofilters.

CopyPaste(String, Area, CopyPasteProperties)

Copies an area of cells from another Worksheet to cells in this worksheet.

CopyPaste(String, Area)

Copies an area of cells from another Worksheet to cells in this worksheet.

CreateAnchor(Int32, Int32, Double, Double)

Creates an anchor at a specified position in the= worksheet.

CreateArea(Int32, Int32, Int32, Int32)

Defines a rectangular Area of cells in the worksheet.

CreateArea(String)

Defines a rectangular Area of cells in the worksheet.

CreateAreaOfColumns(Int32, Int32)

Returns an Area object representing all the cells in a specified group of columns. An are= a is a rectangular collection of cells.

CreateAreaOfRows(Int32, Int32)

Returns an Area object representing all the cells in a specified group of rows. An area i= s a rectangular collection of cells.

CreateNamedRange(Int32, Int32, Int32, Int32, String)

Creates a named range, containing one area. A ra= nge is a collection of areas; an area is a rectangular collection of cells.=

CreateNamedRange(String, String)

Creates a named range from a specified formula. = A range is a collection of areas; an area is a rectangular collection of ce= lls. This method can be used to create a non-rectangular range containing m= ultiple rectangular areas.

CreateRange(String)

Creates a range from a specified formula. A rang= e is a collection of areas; an area is a rectangular collection of cells. T= his method can be used to create a non-rectangular range containing multipl= e rectangular areas.

DeleteColumn(Int32)

Deletes a column and its contents from the works= heet. Columns after the deleted column will be moved to the left.

DeleteColumns(Int32, Int32)

Deletes a number of columns and its contents fro= m the worksheet. Columns after the deleted columns will be moved to the lef= t.

DeleteRow(Int32)

Deletes a specified row and its contents from th= e worksheet. Rows below the deleted row will be moved up.

DeleteRows(Int32, Int32)

Deletes a specified number of rows and its conte= nts from the worksheet. Rows below the deleted rows will be moved up.

GetColumnProperties(Int32)

Returns a ColumnProperties object representing the column specified by index.=

GetNamedObject(String)

Returns the NamedObject object that represents the name of a specified array, numb= er, picture, or range. If the named object does not exist, the method retur= ns null.

GetNamedRange(String)

Returns the named Range object that specified by name. If the named range does not exist= , the method returns null.

GetRowProperties(Int32)

Returns a RowProperties object representing the row specified by index.

GroupColumns(Int32, Int32, Boolean)

Groups or outlines a contiguous set of columns.<= /td>

GroupRows(Int32, Int32, Boolean)

Groups or outlines a contiguous set of rows.

ImportData(Object()(), Cell)

Imports data from a two-dimensional array of obj= ects to cells in the worksheet.

ImportData(Object()(), String(), Cell, DataImportProperties)

=
Imports data from a two-dimensional array of obj= ects to cells in the worksheet. The new data will overwrite values and formulas in the target works= heet cells, but existing formatting will be preserved.

ImportData(System.Data.DataTable, Cell)

Imports data from an ADO.NET DataTable to cells in the worksheet. The new= data will overwrite val= ues and formulas in the target worksheet cells, but existing formatting wil= l be preserved.

ImportData(System.Data.DataTable, Cell, DataImportProperties)

Imports data from an ADO.NET DataTable to cells in the worksheet. The new= data will overwrite val= ues and formulas in the target worksheet cells, but existing formatting wil= l be preserved.

ImportData(System.Data.DataView, Cell)

Imports data from an ADO.NET DataView to cells in the worksheet. The new = data will overwrite valu= es and formulas in the target worksheet cells, but existing formatting will= be preserved.

ImportData(System.Data.DataView, Cell, DataImportProperties)

=
Imports data from an ADO.NET DataView to cells in the worksheet. The new = data will overwrite valu= es and formulas in the target worksheet cells, but existing formatting will= be preserved.

ImportData(Object(,), Cell)

Imports data from a rectangular array of objects= to cells in the worksheet. The new data will overwrite values and formulas in the target worksheet= cells, but existing formatting will be preserved.

ImportData(Object(,), String(), Cell, DataImportProperties)

<= /td>
Imports data from a rectangular array of objects= to cells in the worksheet. The new data will overwrite values and formulas in the target worksheet= cells, but existing formatting will be preserved.

ImportData(System.Data.IDataReader, Cell)

Imports data from an IDataReader to cells in the worksheet. The new data = will overwrite values an= d formulas in the target worksheet cells, but existing formatting will be p= reserved.

ImportData(System.Data.IDataReader, Cell, DataImportProperties)<= /p>

Imports data from an IDataReader to cells in the worksheet. The new data = will overwrite values an= d formulas in the target worksheet cells, but existing formatting will be p= reserved.

InsertColumn(Int32)

Inserts a column in the worksheet to the left of= the specified column.

InsertColumn(Int32, ColumnInsertBehavior)

Inserts a column in the worksheet to the left of= the specified column, copying the style based on the copyBehavior parameter.

InsertColumn(Int32, ColumnInsertBehavior, ColumnInsertBehavior)<= /p>

Inserts a column in the worksheet to the left of= the specified column, copying the style based on the copyBehavior parameter.

InsertColumns(Int32, Int32)

Inserts a block of columns in the worksheet to t= he left of the specified column.

InsertColumns(Int32, Int32, ColumnInsertBehavior)

Inserts a block of columns in the worksheet to t= he left of the specified column, copying the style based on the copyB= ehavior parameter.

InsertColumns(Int32, Int32, ColumnInsertBehavior, ColumnInsertBehavi= or)

Inserts a block of columns in the worksheet to t= he left of the specified column, copying the style based on the copyB= ehavior parameter.

InsertHorizontalPageBreak(Cell)

Inserts a horizontal page break in the worksheet= after the specified cell.

InsertRow(Int32)

Inserts a row in the worksheet above the specifi= ed row.

InsertRow(Int32, RowInsertBehavior)

Inserts a row in the worksheet above the specifi= ed row.

InsertRow(Int32, RowInsertBehavior, RowInsertBehavior)

Inserts a row in the worksheet above the specifi= ed row.

InsertRows(Int32, Int32)

Inserts a number of rows in the worksheet above = the specified row.

InsertRows(Int32, Int32, RowInsertBehavior)

Inserts a number of rows in the worksheet above = the specified row.

InsertRows(Int32, Int32, RowInsertBehavior, RowInsertBehavior)

Inserts a number of rows in the worksheet above = the specified row.

InsertVerticalPageBreak(Cell)

Inserts a vertical page break in the worksheet t= o right of the specified cell.

Protect(String)

Write-protects the worksheet. A user will not be= able to modify the worksheet in Excel without entering the specified passw= ord. This method does not encrypt the worksheet.

Select()

Selects the current worksheet and deselects all = others. To select multiple worksheets, use Worksheets.Select().

UngroupColumns(Int32, Int32)

Ungroups a contiguous set of columns.

UngroupRows(Int32, Int32)

Ungroups a contiguous set of rows.

Unprotect()

Removes the write-protection from the worksheet.=
=20

Extension Methods

Overload

Description

ImportData(Cell, Microsoft.SharePoint.SPList, DataImportProperties)<= /a>

Imports data from a SharePoint List to cells in = the worksheet. The new data will overwrite values and formulas in the targe= t worksheet cells, but existing formatting will be preserved.

ImportData(Cell, Microsoft.SharePoint.SPList)

Imports data from a SharePoint List to cells in = the worksheet. The new data will overwrite values and formulas in the targe= t worksheet cells, but existing formatting will be preserved.

ImportData(Cell, Microsoft.SharePoint.SPView, Microsoft.SharePoint.S= PList, DataImportProperties)

Imports data from a SharePoint View to cells in = the worksheet. The new data will overwrite values and formulas in the targe= t worksheet cells, but existing formatting will be preserved.

ImportData(Cell, Microsoft.SharePoint.SPView, Microsoft.SharePoint.S= PList)

Imports data from a SharePoint View to cells in = the worksheet. The new data will overwrite values and formulas in the targe= t worksheet cells, but existing formatting will be preserved.

Nested Classes

Name

Description

= Constants

Defines a set of constants related to worksheets= .

SheetViewState

A SheetViewState value specifies the view state of a worksheet in Exc= el.

SheetVisibility

A SheetVisibility value specifies the visibility level of a workshee= t.

SummaryColumnsLocation

A SummaryColumnsLocation value specifies the location of the = summary column for a set of grouped columns.

SummaryRowsLocation

A SummaryColumnsLocation value specifies the location of the = summary row for a set of grouped rows.
------=_Part_9032_1584525797.1711673530803--