I am trying to apply colours to certain cells in a spreadsheet generated by Spreadsheet Gear.
My current code
var workbook = Factory.GetWorkbook();
var worksheet = workbook.Worksheets["Sheet1"];
// Set the new worksheet name
worksheet.Name = "Group export";
var cells = worksheet.Cells;
cells[0, 0].Style.Font.Size = 20;
cells[5, 0].Value = "Default Values";
cells["A6"].Style.Interior.Color = System.Drawing.Color.FromArgb(166,166,166); //Line 86
However, when opening the spreadsheet, I find that the font size and cell colour is applied to every single cell in the spreadsheet. The "Default Values" cell is only in the correct cell, however any background or font styling I apply anywhere in sheet applies to all cells.
I set up a watch for cells["A6"].Style.Interior.Color and cells["A5"].Style.Interior.Color, and a breakpoint directly after line 86 to confirm that this is where the styling happens.
Why is the styling applying to all cells in the spreadsheet?