[Solved] Find the exact address of Macro

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

[Solved] Find the exact address of Macro

Post by Math »

I have hundreds of Macros belonging to a File, which are distributed in many different Modules.

               Do I need to know the exact location (address) of a Macro ?

              for example:

              I want to know the exact path of Macro38 ? that is, the address of the Library and Module containing this Macro38 ?

hugs
Last edited by Math on Fri Nov 16, 2018 11:30 am, edited 1 time in total.
LibreOffice 5.4.4.2 on Windows 7
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

Re: Find the exact address of Macro

Post by Math »

I need more precise location of the Macro, since I have many Macros distributed in many different modules.

not all macros have Control Button, so I need the Macro Location address, because There is no control button for all macros.

hugs.
LibreOffice 5.4.4.2 on Windows 7
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Find the exact address of Macro

Post by Zizi64 »

Open the Basic IDE and search for the name of the macro.
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.
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

Re: Find the exact address of Macro

Post by Math »

greetings mr. Zizi64 ,

                
                 by this procedure, I need to know in advance the name of the module where the macro is ? right ?

                 is there any BASIC command that tells the Macro Path inside the Basic IDE ?


hugs .
LibreOffice 5.4.4.2 on Windows 7
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Find the exact address of Macro

Post by Lupp »

Math wrote:by this procedure, I need to know in advance the name of the module where the macro is ? right ?
No.
You can search a complete library, 'Standard' most likely.
Having found your macro you can look into the organiser again to see the module where it is contained.
It's a bit better supported in LibO where the Basic IDE has a tool (may be docked) to show the structure of libraries and modules all the time.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
JeJe
Volunteer
Posts: 2784
Joined: Wed Mar 09, 2016 2:40 pm

Re: Find the exact address of Macro

Post by JeJe »

I think Lupp is talking about the Object Catalogue... its in OO as well - there's a button in the Standard Toolbar to show it.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Find the exact address of Macro

Post by Zizi64 »

I think Lupp is talking about the Object Catalogue... its in OO as well - there's a button in the Standard Toolbar to show it.
Yes, there is; but the panel seems NOT dockable in the AOO.
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
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Find the exact address of Macro

Post by Lupp »

I talked about a search for the name with F&R. Of course there may be cases where many occurrences are found where the macro is called before the headline of the definition comes in sight. I think it's bearable.
We may also search for "Sub macro38" or "Function macro38" to enhance speed".
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

Re: Find the exact address of Macro

Post by Math »

sr. Lupp ,

        I'm a new user in LibreOffice, I did not understand with clarity what you wanted to say about: F & R ??
 
        Could you pass me more details of the way up to get to that F & R ??


Thanks a lot for the help
LibreOffice 5.4.4.2 on Windows 7
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Find the exact address of Macro

Post by Zizi64 »

The "F & R" abbreviation means the "Find and Replace" function. All of the applications (Writer, Calc, Draw...) and even the IDE contain this function.

From the menu:
Edit - Find and Replace
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.
JeJe
Volunteer
Posts: 2784
Joined: Wed Mar 09, 2016 2:40 pm

Re: Find the exact address of Macro

Post by JeJe »

You don't need to know the full address of the macro to call it... ie which module its in. OO will find it and run it provided you type the right name.

There will be difficulties if the macro is in a library which hasn't yet been loaded (you need to make sure the library of macros is loaded before you can use the macro). And if you have more than one macro with the same name then the one you expect to be called might not be.

Its best to give meaningful names to macros based on what the macro does... "Macro38" wouldn't be a good choice...

Edit: One thing you could do is create a module that acts as a kind of index for the macros you need to find easily.

Sub macro1B
call macro1
end sub

sub macro2B (parameter1,parameter2)
call macro2 (parameter1,parameter2)
end sub

function macro3B (parameter1,parameter2)
macro3B = macro3 (parameter1,parameter2)
end function

'etc
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

Re: Find the exact address of Macro

Post by Math »

Many thanks to everyone for the help.

hugs.
LibreOffice 5.4.4.2 on Windows 7
Post Reply