Apache OpenOffice (AOO) Bugzilla – Issue 78256
LOOKUP function doesn't work in a macro
Last modified: 2007-08-07 09:50:37 UTC
I have a Calc spreadsheet with a macro that calls the LOOKUP function using the FuncService.callFunction method. This worked fine in OOo 1.1.0. However, when I open this spreadsheet in OOo 2.0.2 and run the macro, the LOOKUP function doesn't return any matching data, even though in OOo 1.1.0 it finds a match. Has anyone seen this kind of problem (I couldn't find any issues that sounded similar)?
If you can attach the file and step by step instructions on how to reproduce the problem it would help greatly.
Created attachment 46397 [details] Spreadsheet & embedded macro
Created attachment 46398 [details] Standalone macro code
Hopefully I've managed to attach two files: "Donations - Debug.sxc" - the spreadsheet with the problem (I think this file also contains the macro code as well - hope that won't cause the file to be blocked) "Update_R68.bas" - the macro code in a separate file To show the problem in OOo 2.0.2 open the spreadsheet (enabling macros) then press the "Update R68" button on the "Gifts" sheet. I get an error stating "BASIC runtime error. Object variable not set." Opening the spreadsheet in OOo 1.1.0 and running the macro works fine.
Hi, checked this documewnt with 1.1.5 and got the same Error message as with 2.2.1 . So this document itself or better it's Macro code is faulty. I will attach a document which is fixed by DR and will work. Have a look at the line with the YEARFRAC function call to see how he made it work. Thanks Daniel. Frank
Created attachment 47335 [details] fixed bugdoc
closed invalid
I tried the modified spreadsheet but this gave an incorrect result when run in OOo 2.0, but the correct result in OOo 1.1. The problem is with the LOOKUP function, not YEARFRAC. LOOKUP should find a match for all donors in the spreadsheet, but it doesn't. I ran in debug after placing a breakpoint at the modified line of code. Looking at the values of "donor_first_name", "donor_last_name" and "declaration_date" variables after hitting the breakpoint shows that none of them have been updated by the result of the LOOKUP functions - presumably because LOOKUP has not found any matches.
Hi, so this is also a double to Issue 58286 . Your search vector is not sorted. Please have a look at the mentioned Issue and it's duplicates and follow up's. You may have a look at Issue 2168 for the reason of this change. Frank *** This issue has been marked as a duplicate of 58286 ***
closed double