//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; //Change to build in name style. worksheet.Range["A1"].Value = "Bad"; // Bad is a built-in style. worksheet.Range["A1"].Style = workbook.Styles["Bad"]; // Save to an excel file workbook.Save("ApplyStyle.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) 'Change to build in name style. worksheet.Range!A1.Value = "Bad" ' Bad is a built-in style. worksheet.Range!A1.Style = workbook.Styles("Bad") ' save to an excel file workbook.Save("ApplyStyle.xlsx")