SetName

function SetName(sName: string = null): void

Description

Sets a name to the current active sheet.

Parameters

sNamestringdefault: null

The name which will be displayed for the current sheet at the sheet tab.

Returns

void

Try It

var oWorksheet = Api.GetActiveSheet();
oWorksheet.SetName("sheet 1");
var sName = oWorksheet.GetName();
oWorksheet.GetRange("A1").SetValue("Worksheet name: ");
oWorksheet.GetRange("A1").AutoFit(false, true);
oWorksheet.GetRange("B1").SetValue(sName);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).