//Instantiating a Workbook object
Workbook workbook = newWorkbook();//Adding a new worksheet to the Workbook object
int i =workbook.Worksheets.Add();//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet =workbook.Worksheets[i];//Adding the current system date to "A1" cell
worksheet.Cells["A1"].PutValue(DateTime.Now);//Getting the Style of the A1 Cell
Style style = worksheet.Cells["A1"].GetStyle();//Setting the display format to number 15 to show date as "d-mmm-yy"
style.Number = 15;//Applying the style to the A1 cell
worksheet.Cells["A1"].SetStyle(style);//Adding a numeric value to "A2" cell
worksheet.Cells["A2"].PutValue(20);//Getting the Style of the A2 Cell
style = worksheet.Cells["A2"].GetStyle();//Setting the display format to number