Is it possible to change the attribute CellRange.FormatType to be public? I know there is the NumberFormat attribute, but this doesn't provide the information in the right way.
Many thanks in advance,
Darren.
Workbook wb = new Workbook();
wb.LoadFromFile("test.xlsx");
Worksheet sheet = wb.Worksheets[0];
CellRange cell = sheet.Range["A1"];
string formatType = sheet.GetCellType(cell.Row, cell.Column, false).ToString();
string numberFormat = cell.NumberFormat;
if ("Number".Equals(formatType))
{
if (cell.HasDateTime)
{
formatType = "DateTime";
}
if (!string.IsNullOrEmpty(numberFormat) && (numberFormat.Contains("$") || numberFormat.Contains("¥")))
{
formatType = "Currency";
}
}