Skip to main content

ApiWorksheet

Represents the ApiWorksheet class.

Properties

NameTypeDescription
ActivenumberMakes the current sheet active.
ActiveCellApiRangeReturns an object that represents an active cell.
AllProtectedRangesApiProtectedRange[]Returns all protected ranges from the current worksheet.
AutoFilterApiAutoFilterReturns AutoFilter that represents all applied autofilters
BottomMarginnumberReturns or sets the size of the sheet bottom margin measured in points.
CellsApiRangeReturns ApiRange that represents all the cells on the worksheet (not just the cells that are currently in use).
ColsApiRangeReturns ApiRange that represents all the cells of the columns range.
CommentsApiComment[]Returns all comments from the current worksheet.
DefnamesApiName[]Returns an array of the ApiName objects.
FreezePanesApiFreezePanesReturns the freeze panes for the current worksheet.
IndexnumberReturns a sheet index.
LeftMarginnumberReturns or sets the size of the sheet left margin measured in points.
NamestringReturns or sets a name of the active sheet.
PageOrientationPageOrientationReturns or sets the page orientation.
PivotTablesApiPivotTable[]Returns all pivot tables from the current worksheet.
PrintGridlinesbooleanReturns or sets the page PrintGridlines property.
PrintHeadingsbooleanReturns or sets the page PrintHeadings property.
RightMarginnumberReturns or sets the size of the sheet right margin measured in points.
RowsApiRangeReturns ApiRange that represents all the cells of the rows range.
SelectionApiRangeReturns an object that represents the selected range.
TopMarginnumberReturns or sets the size of the sheet top margin measured in points.
UsedRangeApiRangeReturns ApiRange that represents the used range on the specified worksheet.
VisiblebooleanReturns or sets the state of sheet visibility.

Methods

MethodReturnsDescription
AddChartApiChart | nullCreates a chart of the specified type from the selected data range of the current sheet.
AddDefNamebooleanAdds a new name to the current worksheet.
AddDrawingbooleanAdds a detached drawing object (e.g. a copy returned by ApiDrawing.Copy) to the worksheet at the specified anchor.
AddImageApiImageAdds an image to the current sheet with the parameters specified.
AddListObjectApiListObject | nullAdds a formatted table to the worksheet and returns the ApiListObject object.
AddOleObjectApiOleObjectAdds an OLE object to the current sheet with the parameters specified.
AddProtectedRangeApiProtectedRange | nullCreates a protected range of the specified type from the selected data range of the current sheet.
AddShapeApiShapeAdds a shape to the current sheet with the parameters specified.
AddWordArtApiDrawingAdds a Text Art object to the current sheet with the parameters specified.
DeletebooleanDeletes the current worksheet.
FormatAsTablebooleanFormats the selected range of cells from the current sheet as a table (with the first row formatted as a header).
GetActiveCellApiRangeReturns an object that represents an active cell.
GetAllChartsApiChart[]Returns all charts from the current sheet.
GetAllDrawingsDrawing[]Returns all drawings from the current sheet.
GetAllImagesApiImage[]Returns all images from the current sheet.
GetAllOleObjectsApiOleObject[]Returns all OLE objects from the current sheet.
GetAllPivotTablesApiPivotTable[]Returns all pivot tables from the current worksheet.
GetAllProtectedRangesApiProtectedRange[] | nullReturns all protected ranges from the current worksheet.
GetAllShapesApiShape[]Returns all shapes from the current sheet.
GetAutoFilterApiAutoFilterReturns the instante of ApiAutoFilter object that represents the worksheet AutoFilter.
GetBottomMarginnumberReturns the bottom margin of the sheet.
GetCellsApiRange | nullReturns the ApiRange that represents all the cells on the worksheet (not just the cells that are currently in use).
GetColsApiRangeReturns the ApiRange object that represents all the cells on the columns range.
GetCommentsApiComment[]Returns all comments from the current worksheet.
GetCustomXmlPartsApiCustomXmlParts | nullRetrieves the custom XML manager associated with the current sheet.
GetDefNameApiName | nullReturns the ApiName object by the worksheet name.
GetDefNamesApiName[]Returns an array of ApiName objects.
GetFreezePanesApiFreezePanesReturns the freeze panes from the current worksheet.
GetIndexnumberReturns a sheet index.
GetLeftMarginnumberReturns the left margin of the sheet.
GetListObjectsApiListObject[]Returns an array of ApiListObject objects representing the formatted tables on the worksheet.
GetNamestringReturns a sheet name.
GetPageOrientationPageOrientationReturns the page orientation.
GetPivotByNameApiPivotTable | nullReturns a pivot table by its name from the current worksheet, or null if it does not exist.
GetPrintGridlinesbooleanReturns the page PrintGridlines property which specifies whether the current sheet gridlines must be printed or not.
GetPrintHeadingsbooleanReturns the page PrintHeadings property which specifies whether the current sheet row/column headings must be printed or not.
GetProtectedRangeApiProtectedRange | nullReturns a protected range object by its title.
GetRangeApiRange | nullReturns an object that represents the selected range of the current sheet. Can be a single cell - A1, or cells
GetRangeByNumberApiRangeReturns an object that represents the selected range of the current sheet using the row/column coordinates for the cell selection.
GetRightMarginnumberReturns the right margin of the sheet.
GetRowsApiRange | nullReturns the ApiRange object that represents all the cells on the rows range.
GetSelectedDrawingsDrawing[]Returns selected drawings from the current sheet.
GetSelectedShapesApiShape[]Returns selected shapes from the current sheet.
GetSelectionApiRangeReturns an object that represents the selected range.
GetTopMarginnumberReturns the top margin of the sheet.
GetUsedRangeApiRangeReturns the ApiRange object that represents the used range on the specified worksheet.
GetVisiblebooleanReturns the state of sheet visibility.
MoveNoneMoves the current sheet to another location in the workbook.
PasteNonePastes the contents of the clipboard to the current sheet.
RefreshAllPivotsNoneRefreshes all pivot tables on the current worksheet.
ReplaceCurrentImagebooleanReplaces the current image with a new one.
SetActivebooleanMakes the current sheet active.
SetBottomMarginbooleanSets the bottom margin of the sheet.
SetColumnWidthbooleanSets the width of the specified column.
SetDisplayGridlinesbooleanSpecifies whether the current sheet gridlines must be displayed or not.
SetDisplayHeadingsbooleanSpecifies whether the current sheet row/column headers must be displayed or not.
SetHyperlinkbooleanAdds a hyperlink to the specified range.
SetLeftMarginbooleanSets the left margin of the sheet.
SetNameNoneSets a name to the current active sheet.
SetPageOrientationbooleanSets the page orientation.
SetPrintGridlinesbooleanSpecifies whether the current sheet gridlines must be printed or not.
SetPrintHeadingsbooleanSpecifies whether the current sheet row/column headers must be printed or not.
SetRightMarginbooleanSets the right margin of the sheet.
SetRowHeightbooleanSets the height of the specified row measured in points.
SetTopMarginbooleanSets the top margin of the sheet.
SetVisiblebooleanSets the state of sheet visibility.