//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; worksheet.Range["A1:B2"].Value = new object[,] { {1, 2}, {"aaa", "bbb"} }; worksheet.Range["A2:C3"].Interior.Color = Color.Green; //style used range is A2:C3. var UsedRange_style = worksheet.GetUsedRange(UsedRangeType.Style); UsedRange_style.Interior.Color = Color.LightBlue; // Save to an excel file workbook.Save("GetFeatureRelatedUsedRange.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) worksheet.Range("A1:B2").Value = New Object(,) { {1, 2}, {"aaa", "bbb"} } worksheet.Range("A2:C3").Interior.Color = Color.Green 'style used range is A2:C3. Dim UsedRange_style = worksheet.GetUsedRange(UsedRangeType.Style) UsedRange_style.Interior.Color = Color.LightBlue ' save to an excel file workbook.Save("GetFeatureRelatedUsedRange.xlsx")