Other API Samples

Live SpreadsheetGear API Samples

Snippets Font

A sample that sets the font of cell A1 to Times New Roman 24pt, dark green, and bold.

IWorkbook workbook = Factory.GetWorkbook();
IWorksheet worksheet = workbook.ActiveWorksheet;
IRange cells = worksheet.Cells;
cells["A1"].Value = "Hello World!";
cells["A1"].Font.Name = "Times New Roman";
cells["A1"].Font.Color = SpreadsheetGear.Colors.DarkGreen;
cells["A1"].Font.Bold = true;
cells["A1"].Font.Size = 24;
Run This Sample
Render Image

Generate an image representation of the results of this sample, which uses the SpreadsheetGear.Drawing.Image class to convert ranges, charts and shapes to images.


Download File

Download an Excel Open XML Workbook (*.xlsx) file with the results of this sample.