Get Started
Usage API

SetFontName

SetFontName(sName)

Set the specified font family as the font name for the current cell range.

Parameters:

Name Type Description
sName string

The font family name used for the current cell range.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A2").SetValue("2");
sRange = oWorksheet.GetRange("A1:D5");
sRange.SetFontName("Arial");
builder.SaveFile("xlsx", "SetFontName.xlsx");
builder.CloseFile();

Resulting document