Hi,
I’m not able to get the default cell style.
SCENARIO
For the I7 cell I did’n set any style explicitly, “Normal” style is added by default by Excel
for the I8 cell, I’ve set the style to “Bad”.
C# CODE
string filePath = @“c:\ExcelFile.xlsx”;
Workbook workbook = new Workbook(filePath);
Worksheet worksheet = workbook.Worksheets[0];
//i7 cell style name
Cell i7 = worksheet.Cells[“I7”];
var i7Style = i7.GetStyle();
var i7ParentStyle = i7Style.ParentStyle;
Debug.WriteLine("i7 Parent Style Name: " + (i7ParentStyle == null ? “null” : i7ParentStyle.Name));
//i8 cell style name
Cell i8 = worksheet.Cells[“I8”];
var i8Style = i8.GetStyle();
var i8ParentStyle = i8Style.ParentStyle;
Debug.WriteLine("i8 Parent Style Name: " + (i8ParentStyle == null ? “null” : i8ParentStyle.Name));
DEBUG OUTPUT
i7 Parent Style Name: null
i8 Parent Style Name: Bad
EXPECTATION :
The style for I7 should be "Normal"
MsgBox Worksheets(“Sheet1”).Range(“I7”).Style.Name
End Sub