We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Set default font for worksheet

Hi

how can i set font or other styles for worksheet, not just for one row or column.
thanks

Hi,

Thanks for your posting and using Aspose.Cells.

You can change the default font of the workbook using the following code. The code changes the default font to Arial Narrow and the font size to 15.

I have attached the output xlsx file generated by it for your reference.

C#


Workbook workbook = new Workbook();


Style style = workbook.CreateStyle();

style.Font.Name = “Arial Narrow”;

style.Font.Size = 15;


workbook.DefaultStyle = style;


workbook.Save(“output.xlsx”);