I am trying to port my existing Aspose.Excel code to Aspose.Cells and I can no longer set the styles and Background color. We are looking at upgrading because I heard .Cells supports setting the style for a Range, whereas .Excel did not. I am using the following code to no avail:
Style styleTest = this._excelCalendar.Styles[this._excelCalendar.Styles.Add()];
_excelCalendar.ChangePalette(Color.LemonChiffon, 31);
styleTest.BackgroundColor = Color.LemonChiffon;
styleTest.Pattern = BackgroundType.Solid;
styleTest.HorizontalAlignment = TextAlignmentType.Center;
styleTest.VerticalAlignment = TextAlignmentType.Center;
styleTest.Font.Size = 10;
styleTest.Font.IsBold = true;
_excelCalendar.Worksheets[0].Cells[20, 20].Style = styleTest;
_excelCalendar.Worksheets[0].Cells[20, 20].PutValue("WTF????");
this._excelCalendar.Worksheets[worksheetIndex].Cells[5, 5].Style.ForegroundColor = Color.Gray;
Range rangeHoliday = this._excelCalendar.Worksheets[worksheetIndex].Cells.CreateRange(5, 5, 40, 1);
rangeHoliday.SetOutlineBorder(BorderType.LeftBorder, CellBorderType.Thin, Color.Black);
rangeHoliday.SetOutlineBorder(BorderType.RightBorder, CellBorderType.Thin, Color.Black);
rangeHoliday.SetOutlineBorder(BorderType.TopBorder, CellBorderType.Thin, Color.Black);
rangeHoliday.SetOutlineBorder(BorderType.BottomBorder, CellBorderType.Thin, Color.Black);
rangeHoliday.Style = styleTest;
PLease help.