I have a workbook with an existing custom table style. The first issue I ran into is that ClosedXML throws an error when opening an existing workbook where a table uses a custom style. The error is: "Requested value 'StyleName' was not found." and trace:
I suspect that it is currently a limitation, and that the error is related. I believe the code is trying to parse the table Style name and find it within the XLTableTheme Enum.
Is this a current limitation? Is there a workaround for this issue? If there is no plan to support custom table styles directly, is it perhaps possible to catch a Parse error on the table style enum and use a 'default' table style - to allow existing workbooks with custom styles to be opened?
Thanks and kind regards,
at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at System.Enum.Parse(Type enumType, String value)
at ClosedXML.Excel.XLWorkbook.LoadSpreadsheetDocument(SpreadsheetDocument
As I didn't need to have preexisting tables this was okay. However I can't figure out how to apply my custom theme to a new table. I suspect that it is currently a limitation, and that the error is related. I believe the code is trying to parse the table Style name and find it within the XLTableTheme Enum.
Is this a current limitation? Is there a workaround for this issue? If there is no plan to support custom table styles directly, is it perhaps possible to catch a Parse error on the table style enum and use a 'default' table style - to allow existing workbooks with custom styles to be opened?
Thanks and kind regards,