Pop-up for: Do you really want to?
Pop-up for: Do you really want to?
Hi There
Is there a facility attached to "buttons" that has a pop-up that asks if you really want to do whatever the button does?
I have a macro attached to a button in a spreadsheet set that does about 7 different things if clicked. It is only clicked if what it does is required but I have had people click on it accidentally and they don't know how to reverse what they just did
Cheers Jim
Is there a facility attached to "buttons" that has a pop-up that asks if you really want to do whatever the button does?
I have a macro attached to a button in a spreadsheet set that does about 7 different things if clicked. It is only clicked if what it does is required but I have had people click on it accidentally and they don't know how to reverse what they just did
Cheers Jim
Last edited by MrProgrammer on Wed Aug 13, 2025 2:15 am, edited 1 time in total.
Reason: Edited topic's subject
Reason: Edited topic's subject
OpenOffice 4.1.13
Re: DO YOU REALLY WANT TO POP UP
A message box is one solution - MsgBox in the Wiki
Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 25.8.1.1; SlackBuild for 25.8.1 by Eric Hameleers
---------------------
Apache OpenOffice 4.1.15
LibreOffice 25.8.1.1; SlackBuild for 25.8.1 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue]
Unexpected '{' on line 32
.Re: Pop-up for: Do you really want to?
It isn't "in the Calc"; you need to script it as part of the macro. The link I gave above has an example very similar to what you want. You would probably put the message box as the first thing in the macro, depending on exactly what the macro does.
Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 25.8.1.1; SlackBuild for 25.8.1 by Eric Hameleers
---------------------
Apache OpenOffice 4.1.15
LibreOffice 25.8.1.1; SlackBuild for 25.8.1 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue]
Unexpected '{' on line 32
.Re: Pop-up for: Do you really want to?
Not sure what you actually mean by "script it as part of the macro"
To make the macro I go to tools - macros - record macro and do the sorting and other things then stop recording and give it a name.
I then assign that macro to a push button.
I cannot see where or when I can introduce MsgBox
Jim
To make the macro I go to tools - macros - record macro and do the sorting and other things then stop recording and give it a name.
I then assign that macro to a push button.
I cannot see where or when I can introduce MsgBox
Jim
OpenOffice 4.1.13
Re: Pop-up for: Do you really want to?
You have to edit the macro and add the relevant code.
Tools | Macros | Organise Macros | OpenOffice Basic; assuming that is where you saved your recorded macro. Then select the macro and use the Edit button to edit it.
Tools | Macros | Organise Macros | OpenOffice Basic; assuming that is where you saved your recorded macro. Then select the macro and use the Edit button to edit it.
Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 25.8.1.1; SlackBuild for 25.8.1 by Eric Hameleers
---------------------
Apache OpenOffice 4.1.15
LibreOffice 25.8.1.1; SlackBuild for 25.8.1 by Eric Hameleers
---------------------
Roses are Red, Violets are Blue]
Unexpected '{' on line 32
.Re: Pop-up for: Do you really want to?
@jimbokea2: you would be well advised to read the programming guide to OpenOffice BASIC at
https://wiki.openoffice.org/wiki/Docume ... ASIC_Guide
This will give you an understanding of the code the record macro facility is providing and aid your modification of it.
https://wiki.openoffice.org/wiki/Docume ... ASIC_Guide
This will give you an understanding of the code the record macro facility is providing and aid your modification of it.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.5 LTS
Re: Pop-up for: Do you really want to?
Where is your difficulty?
Assign this sub to the control execute action event.
Otherwise I suggest you post a stripped down version of the document (with sensitive information removed) for people to look at.
Code: Select all
Sub Message
iRet = MsgBox("Should I continue?", 4, "Confirm")
if iRet = 6 then
'Press Yes...
else
'Press No...
endif
End Sub
Otherwise I suggest you post a stripped down version of the document (with sensitive information removed) for people to look at.
Co-admin french forum branch
Re: Pop-up for: Do you really want to?
(@Bidouille; You sure you don't mix up "MsgBox" and "InputBox"?)
@jimbokea2:
See attached example:
@jimbokea2:
See attached example:
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
- MrProgrammer
- Moderator
- Posts: 5322
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Pop-up for: Do you really want to?
MsgBox Function: Displays a dialog box containing a message and returns a value Syntax: MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) Text: String expression displayed as a message in dialog box Type: Specifies buttons or icons displayed Displayed buttons + Icon + Default button 0: OK 16: Stop 128: First 1: OK Cancel 32: Question 256: Second 2: Abort Retry Ignore 48: Exclamation 512: Third 3: Cancel Yes No 64: Information 4: Yes No 5: Cancel Retry DialogTitle: String expression displayed in title bar of dialog If omitted, name of application is displayed Return type: Integer Return value: 1: OK, 2: Cancel, 3: Abort, 4: Retry, 5: Ignore, 6: Yes, 7: No
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.7.6, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Pop-up for: Do you really want to?
Sorry and thanks!
I once knew this, but used MsgBox() with only the first argument for a long time now.
Forgot about that functionality.
I once knew this, but used MsgBox() with only the first argument for a long time now.
Forgot about that functionality.
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München