Page 1 of 1

Exception "Error in formula" when using Autofilter.Add

Posted: Tue May 12, 2015 3:03 pm
by simba-dev
In some cases I get an exception "E4006: Error in formula." when using Autofilter.Add for the first fixed row of a sheet. In other cases there is no exception, but Excel shows a message when opening the file, something like "incorrect data format repaired". There are no formulas in the sheet, just a few cells with strings. My code works fine with version 5.20.32, but does not with 5.20.45/47.

Example:
Sheets[0].Pane.SplitColX := 0;
Sheets[0].Pane.SplitRowY := 1;
Sheets[0].Pane.LeftCol := 1;
Sheets[0].Pane.TopRow := 1;
Sheets[0].Pane.PaneType := ptFrozen;
Sheets[0].Autofilter.Add(0,0,10,0);

This is the debug info (read backwards):
0100e88a +08e mainisEBAs.exe XLSUtils5 1454 +10 TXLSErrorManager.Error
011cc7f3 +01b mainisEBAs.exe XLSTokenizer5 986 +3 TXLSTokenizer.TryFormula
011cb401 +011 mainisEBAs.exe XLSTokenizer5 388 +3 TXLSTokenizer.DoToken
011cb53e +0f2 mainisEBAs.exe XLSTokenizer5 471 +34 TXLSTokenizer.Parse
0121b557 +017 mainisEBAs.exe XLSFormula5 917 +2 TXLSFormulaHandler.EncodeFormula
012c7b64 +018 mainisEBAs.exe XLSNames5 270 +2 TXLSName.Compile
012c7f51 +019 mainisEBAs.exe XLSNames5 344 +5 TXLSName.SetDefinition
012c8634 +0ac mainisEBAs.exe XLSAutofilter5 81 +7 TXLSAutofilter.Add

Best regards,
Simba

Re: Exception "Error in formula" when using Autofilter.Add

Posted: Wed May 13, 2015 6:23 am
by larsa
Hello

This will be fixed in the next update.

Re: Exception "Error in formula" when using Autofilter.Add

Posted: Fri May 15, 2015 7:16 am
by simba-dev
This sounds great!