Exception "Error in formula" when using Autofilter.Add

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
simba-dev
Posts: 2
Joined: Thu Dec 01, 2011 8:29 am

Exception "Error in formula" when using Autofilter.Add

Post 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
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

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

Post by larsa »

Hello

This will be fixed in the next update.
Lars Arvidsson, Axolot Data
simba-dev
Posts: 2
Joined: Thu Dec 01, 2011 8:29 am

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

Post by simba-dev »

This sounds great!
Post Reply