CODE

CODE(arg1) → { number }

Returns the code number from your computer's character set for the first character in the specified text string.

Parameters:

Name Type Description
arg1 string

The text for which to get the code of the first character.

Returns:

Type
number

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.CODE("office"));
builder.SaveFile("xlsx", "CODE.xlsx");
builder.CloseFile();

Resulting document