[Dropped] Stop chain of macros and exit from main sub

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Lovepreet323
Posts: 19
Joined: Fri Jun 17, 2022 9:45 am

[Dropped] Stop chain of macros and exit from main sub

Post by Lovepreet323 »

I have a chain of macro list in my calc file. Main sub contains 8 macro names to run in list. 5th macro is for filtering data on sheet1 and next 6th macro is for coping filtered data into sheet3.My concern is that if filtered data is blank and dose not contains any data, then stop all macro to run further. Will anyone help in this.
Last edited by MrProgrammer on Tue Aug 16, 2022 5:08 pm, edited 1 time in total.
Reason: Dropped: No attachment provided when requested -- MrProgrammer, forum moderator
OpenOffice 4.0 on Windows 10
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to stop a chain of macro and exit from main sub

Post by Zizi64 »

Please upload the source code of the macros, and 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.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to stop a chain of macro and exit from main sub

Post by Villeroy »

You really want us to teach you programming on this forum?
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
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: How to stop a chain of macro and exit from main sub

Post by JeJe »

One way is to run each as a function with a boolean return value and If the return is true then proceed with the next function.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
nickGiard
Posts: 16
Joined: Fri Nov 10, 2017 5:57 pm

Re: How to stop a chain of macro and exit from main sub

Post by nickGiard »

If you want get back to main sub, you may use the error handling in the main sub.
In the other subs you must raise your custom error when you want go back in the main, and there manager the exit.
LibreOffice 6.3 on Windows 10 64bit
Post Reply