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.
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
AddChartApiChartCreates a chart of the specified type from the selected data range of the current sheet.\ 💡 Please note that the horizontal and vertical offsets are calculated within the limits of the specified column and\ row cells only. If this value exceeds the cell width or height, another vertical/horizontal position will be set.
AddDefNamebooleanAdds a new name to the current worksheet.
AddImageApiImageAdds an image to the current sheet with the parameters specified.
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.\ 💡 Please note that the horizontal and vertical offsets are\ calculated within the limits of the specified column and row cells\ only. If this value exceeds the cell width or height, another vertical/horizontal position will be set.
AddWordArtApiDrawingAdds a Text Art object to the current sheet with the parameters specified.
DeleteNoneDeletes the current worksheet.
FormatAsTableNoneFormats the selected range of cells from the current sheet as a table (with the first row formatted as a header).\ 💡 As the first row is always formatted as a table header, you need to select at least two rows for the table to be formed correctly.
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.
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.
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.
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\ from a single row - -A1:E1, or cells from a single column - -A1:A10, or cells from several rows and columns - -A1:E10.
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.
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.
GroupDrawingsApiGroupGroups an array of drawings in the current worksheet.
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.
ReplaceCurrentImageNoneReplaces the current image with a new one.
SetActiveNoneMakes the current sheet active.
SetBottomMarginNoneSets the bottom margin of the sheet.
SetColumnWidthNoneSets the width of the specified column.\ One unit of column width is equal to the width of one character in the Normal style.\ For proportional fonts, the width of the character 0 (zero) is used.
SetDisplayGridlinesNoneSpecifies whether the current sheet gridlines must be displayed or not.
SetDisplayHeadingsNoneSpecifies whether the current sheet row/column headers must be displayed or not.
SetHyperlinkNoneAdds a hyperlink to the specified range.
SetLeftMarginNoneSets the left margin of the sheet.
SetNameNoneSets a name to the current active sheet.
SetPageOrientationNoneSets the page orientation.
SetPrintGridlinesNoneSpecifies whether the current sheet gridlines must be printed or not.
SetPrintHeadingsNoneSpecifies whether the current sheet row/column headers must be printed or not.
SetRightMarginNoneSets the right margin of the sheet.
SetRowHeightNoneSets the height of the specified row measured in points.\ A point is 1/72 inch.
SetTopMarginNoneSets the top margin of the sheet.
SetVisibleNoneSets the state of sheet visibility.