Strange runtime error in FlexCel unit.

Having recently upgraded to FlexCel 6.1.18, I'm gettting a Run Time
Error 217 at 004C7994 as soon as I startup my program. After a lot of
searching and tracing through code, I've determined that the error
happens during the initialization phase (ie before the main BEGIN in the
.dpr file)

The error is occuring in unit _UXlsxTables.BuiltinTableStyles, in class function BuiltinTableStyles.ReadTableStyles, which is called by class constructor BuiltinTableStyles.Create which is being called during the program initialization.

I'm using Delphi XE5.

Any advice would be greatly appreciated. Thanks.


My guess would be in an older FlexCel version still installed (at least parts of it) and Delphi mixing both.

The thing is: ReadTableStyles will try to load the built-in tables definitions from a resource embedded in the file XlsAdapterResources.res

Now, the builtin table styles were added to XlsAdapterResources.res in FlexCel 6.17, when we added support for rendering tables. If you are getting an initialization error in BuiltInTableStyles.Create, it is 99.99% likely the cause is that Delphi is linking against an older version of XlsAdapterResources.res from an older FlexCel, which doesn't have the tablestyles.

So before investigating it more, I would first search for  XlsAdapterResources.res in your hard disk, and make sure to remove all the old (not from 6.18) ones. For searching, I can only recommend "everything" from but of course use whatever tool you like. Just make sure no old versions of  XlsAdapterResources.res are around.

Hi Adrian,

Thanks for the fast response. An old version of XlsAdapterResources.res was indeed hanging around! Removed it and now all is fine.

Thanks again.