Possible to use VLOOKUP in a macro?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
moriturimax
Posts: 16
Joined: Sat Sep 15, 2018 9:05 pm

Possible to use VLOOKUP in a macro?

Post by moriturimax »

Is it even possible to use VLookup in a Basic Macro? I keep getting the Parenthesis Do Not Match Error. It's very confusing to search because most search results aren't totally clear on the difference between using the function on a spreadsheet versus using it in a macro.

Any quick help is appreciated...maybe I depend on it too much.
OpenOffice 4.1.5
Windows 10 Pro 64-bit
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Possible to use VLOOKUP in a macro?

Post by Zizi64 »

Possible to use VLOOKUP in a macro?
Yes, you can use the cell functions in your macro code, but you must pass the arguments in an ARRAY type variable to the called function.
Here are some examples (the simple textual range name like "Sheet1.A1:C24" will not work):
viewtopic.php?f=20&t=84945
viewtopic.php?f=45&t=24323
http://ooo-forums.apache.org/en/forum/v ... 20&t=42702

viewtopic.php?f=20&t=78686
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Possible to use VLOOKUP in a macro?

Post by Zizi64 »

Moriturimax, can you upload an ODF type sample file here?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply