[Solved] Can I daisy chain macros within the same module
[Solved] Can I daisy chain macros within the same module
Instead of trying to combine recorded macros into one macro, can I put something at the end of the first that means the second will be run automatically, without getting reports that names and values have already been defined?
Last edited by Hagar Delest on Wed Sep 08, 2021 1:46 pm, edited 1 time in total.
Reason: tagged solved.
Reason: tagged solved.
Libreoffice v7.2.0.4 on Ubuntu 20.04 Locale en-GB
Re: Can I daisy chain macros within the same module
You could write "Call *Macro's name* " in the last line of the first macro to call the second one.
LibreOffice 6.3.2.2 Windows 7 Ultimate
Re: Can I daisy chain macros within the same module
You should learn some programming basics, not by copy/paste, not by playing around, not by forum questions. Consult books, online tutorials, a real life teacher can transfer conceptual knowledge instead of incoherent pieces. It may be difficult to find any books on Basic because Basic is a language of the 90ies. With Python your can script anything including your office suite.
This is more or less the same in all procedural languages:
Same in Python
This is more or less the same in all procedural languages:
Code: Select all
Sub Main()
MyMacro1
MyMacro2
MyMacro3
End Sub
Sub MyMacro1()
REM dummy
End Sub
Sub MyMacro2()
REM dummy
End Sub
Sub MyMacro3()
REM dummy
End Sub
Code: Select all
def Main():
MyMacro1
MyMacro2
MyMacro3
def MyMacro1():
# dummy
pass
def MyMacro2():
# dummy
pass
def MyMacro3():
# dummy
pass
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Can I daisy chain macros within the same module
I spent about 20 years programming in DBase 3. I know it well, but I have not found it available in Ubuntu.
Phrases like the following are difficult for me to understand conceptually.
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args4(0) as new com.sun.star.beans.PropertyValue
What I need to do nowadays can be covered by a combination of the spreadsheet and recorded macros. I am able to make very complex conditions work with the action run by a recorded macro. However I also will slowly introduce python or basic as needed.
Thank you for your continued support.
Phrases like the following are difficult for me to understand conceptually.
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args4(0) as new com.sun.star.beans.PropertyValue
What I need to do nowadays can be covered by a combination of the spreadsheet and recorded macros. I am able to make very complex conditions work with the action run by a recorded macro. However I also will slowly introduce python or basic as needed.
Thank you for your continued support.
Libreoffice v7.2.0.4 on Ubuntu 20.04 Locale en-GB
Re: Can I daisy chain macros within the same module
https://wiki.openoffice.org/wiki/Docume ... Office.org
StarBasic's ThisComponent is the Model
ThisComponent.CurrentController() is the currently active View on the Model. There are more views when you call menu:Window>New Window
ThisComponent.CurrentControler.Frame is the containing frame of a view and its model.
objFrame.Controller.Model goes the other way round.
StarBasic's StarDesktop is the collection of all frames in this office suite.
The MRI extension lets you explore the hierarchy of all objects so you can lookup all the properties and methods of a given object.
[Tutorial] Introduction into object inspection with MRI
Dispatch macros simulate clicks in the user interface. They are very limited and poorly documented.
document = ThisComponent.CurrentController.Frame is misleading. ThisComponent is the document.
StarBasic's ThisComponent is the Model
ThisComponent.CurrentController() is the currently active View on the Model. There are more views when you call menu:Window>New Window
ThisComponent.CurrentControler.Frame is the containing frame of a view and its model.
objFrame.Controller.Model goes the other way round.
StarBasic's StarDesktop is the collection of all frames in this office suite.
The MRI extension lets you explore the hierarchy of all objects so you can lookup all the properties and methods of a given object.
[Tutorial] Introduction into object inspection with MRI
Dispatch macros simulate clicks in the user interface. They are very limited and poorly documented.
document = ThisComponent.CurrentController.Frame is misleading. ThisComponent is the document.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Can I daisy chain macros within the same module
Thank you for that explanation.
I feel I should explain why I would want to join macros together. I have been trying to do a series of standard actions which involve many steps all done together. Ideally they should be in one long macro, but It is very easy to miss out a step and have to redo the whole macro. Following your previous advice relating to hidden columns containing parts of a formula, I thought I would break the macro into sub macros and then join them together by a daisy chain.
I feel I should explain why I would want to join macros together. I have been trying to do a series of standard actions which involve many steps all done together. Ideally they should be in one long macro, but It is very easy to miss out a step and have to redo the whole macro. Following your previous advice relating to hidden columns containing parts of a formula, I thought I would break the macro into sub macros and then join them together by a daisy chain.
Libreoffice v7.2.0.4 on Ubuntu 20.04 Locale en-GB
Re: Can I daisy chain macros within the same module
Code: Select all
Sub macro1()
...
...
...
macro2()
End Sub
Sub macro2()
..
...
macro3()
End Sub
Sub macro3()
...
...
MsgBox("Done!")
End Sub
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
Re: Can I daisy chain macros within the same module
Yes, that is my idea of a daisy chain.
Thank you all for your help.
Thank you all for your help.
Libreoffice v7.2.0.4 on Ubuntu 20.04 Locale en-GB