Steps within a recorded macro

Discuss the spreadsheet application
Post Reply
robbyn
Posts: 62
Joined: Sat Jun 26, 2021 10:01 pm

Steps within a recorded macro

Post by robbyn »

Does lO/ OO only step through a macro when each entry has given feedback that it has been completed?

I have this problem with Shift Ctrl F9. It takes a long time to complete updating a particular spreadsheet. I had put it at the start of a macro and was wondering why the macro does not seem to have run. I am wondering if the rest of it did run but had no effect because the update was still in progress.
Libreoffice v7.2.0.4 on Ubuntu 20.04 Locale en-GB
User avatar
Zizi64
Volunteer
Posts: 11358
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Steps within a recorded macro

Post by Zizi64 »

Please upload an ODF type sample file here, together with the embedded recorded 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.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Steps within a recorded macro

Post by John_Ha »

robbyn wrote:Does lO/ OO only step through a macro when each entry has given feedback that it has been completed?
Probably.

I am sure you can single step through a macro - see controls in image where you can also set breakpoints.
Clipboard01.gif
Clipboard01.gif (9.84 KiB) Viewed 1533 times
Or test by adding multiple message boxes in the macro asking you to allow it to continue to see how it progresses. Use something like

Code: Select all

rem ----------------------------------------------------------------------
' MsgBox("Prompt", buttons, "Title")
' buttons = 1 ... means 2 buttons - OK  (resp = 1) and CANCEL (resp = 2)
' buttons = 4 ... means 2 buttons - YES (resp = 6) and NO     (resp = 7)
rem ----------------------------------------------------------------------

   response = MsgBox( "Continue?",4,"Position in macro")  ' YES and NO buttons

   If (response = 6) Then                  '  6 = YES, I want to continue
   ...
   Else                                    '  7 = NO, I want to stop
   ...
   EndIf
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Post Reply