My modeless message box is used to pause my macro while the user makes a change on the active worksheet.
My problem is that I don’t know how to stop/pause code execution when the message is displayed, so I end the procedure, and the click event in the message box calls a new procedure. This is all very well except when it’s a modification to existing code and all the dim statements have to be reviewed.
Is there an alternative to the modeless message box or another way to use it?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Modeless Message box (Excel 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Modeless Message box (Excel 2000)
- This topic has 7 replies, 3 voices, and was last updated 19 years, 8 months ago.
AuthorTopicWSrossconnell
AskWoody LoungerSeptember 4, 2005 at 10:25 am #423725Viewing 1 reply threadAuthorReplies-
WSHansV
AskWoody LoungerSeptember 4, 2005 at 10:39 am #970789> except when it’s a modification to existing code and all the dim statements have to be reviewed.
Do you mean that the user modifies the code while the message box is displayed? That seems an undesirable situation to me. If I misunderstood, please explain what you mean by the above sentence.
-
WSrossconnell
AskWoody LoungerSeptember 4, 2005 at 10:50 am #970791Hans,
Do you ever sleep?
Sorry, what I meant was that when I modify my code to accommodate the Modeless message box I have to move my dim statements around because now I have two or more procedures. Maybe I’m too restrictive in the scope of my variables, but I only declare them before the procedure when they apply to more than one.
-
-
WSsdckapr
AskWoody Lounger -
WSrossconnell
AskWoody LoungerSeptember 4, 2005 at 11:12 am #970793Steve,
Let’s say we have a list of 10 names and the macro is going to summarize some data for each of the 10. I want the user to review the list and see if any names have to be added or subtracted, and to make sure they are all spelled exactly as they are in the data. The modeless msg remains on the screen while the user edits the list. Is there a better way? -
WSsdckapr
AskWoody LoungerSeptember 4, 2005 at 11:50 am #970795Several options come to mind with the limited info you give. What is best will depend on your needs and wants and abilities:
1) you can make him have the correct entries before running the code. Have a message box asking if there are any errors (or have code check for errors at the start of the code). If there are errors, quit the code and tell the user to rerun after fixing them (if automatic, you can select the cells that are in error, or even list color them, etc)
This bypasses the need to have them make changes while your code is running. It teaches them to enter data correctly before running routines…
2) If you want to have them change code in the middle of a routine, you can create userform which lists the items and have them edit it in the userform. (which “grab” the values from the ranges). After they finish editing the form, the code can validate the entries and, if valid, it can place the values in the appropriate cells, and then continue with the code. You are editing the workbook in the middle of code and not needing the code stopped.
If “automatically” testing, you can indicate which values are “bad” or even just display the “bad values” for editing.
3) you can use an application input box and have the user select the cell to edit, read the value and have them edit it a text input box. You just loop thru these 2 sections (choose a range, edit the value) until they accept it as ok.
Number 1 is probably the easiest to code. If not correct, quit and make them rerun.
Number 2 or its variants seems to be the “most professional looking” of all and (probably) easier of #2 and #3.
Number 3 does not require a user form to be created but gets “clunkier” with all the checking and validation.Steve
-
WSrossconnell
AskWoody LoungerSeptember 4, 2005 at 12:17 pm #970798Steve,
Thank you for taking the time to suggest the various options. The Modeless msg box is notably absent, so I take it you don’t see a better way to use it than I am.
With respect to option 1) There are a number of steps the code must complete before we get to checking the list, so re-starting will not work. Moreover, in principle, I am not happy with code that requires users to be “taught” anything; if the interface is not intuitive it needs improvement.
2) Yes, I could create a Userform, but that would seem to be a lot more work than my modeless msg box. There is no way to validate the input. I have no way of knowing which of the following names is correct: ABC Inc|ABC Inc.|ABC-Inc|
3) This gets closer to what I need, but does seem a bit clunkier than the modeless msg box.
Good ideas but, as you say, with the limited amount of information I provided, not ideal.
Thanks -
WSsdckapr
AskWoody LoungerSeptember 4, 2005 at 1:19 pm #970801But just allowing to edit the userform in #2 (even without validation) is not that different than editing in the workbook (which also does not have validation).
Instead of allowing them to edit directly in the workbook, you are requiring them to edit in the userform (which you could make appear to be “like a worksheet” page if desired.
[indent]
Moreover, in principle, I am not happy with code that requires users to be “taught” anything; if the interface is not intuitive it needs improvement.
[/indent]
I am not saying the interface is not intuitive or needs improvement. What I suggest is teaching them to do what you say you want them to do (while the code the running):
[indent]
I want the user to review the list and see if any names have to be added or subtracted, and to make sure they are all spelled exactly as they are in the data
[/indent]
I think that should be done before the code starts. Ask them to check before the code proceeds too far. (just to ensure that is correct). It seems like you want them to start running code, then part way thru, start their checking. The checking should be done before the code is run, or thru a more controlled means (eg userform) while the code is run.
Concerning whether ABC Inc or ABC Inc. ABC-Inc is correct, can’t you check to see what is in the “data” (match function, looping and comparing), etc. If the user can tell which is correct, the code should at least be able to indicate items that do not exist in the “data”
Perhaps I just don’t completely understand what you are doing…
Steve
-
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
1 hour, 5 minutes ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
1 hour, 7 minutes ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
4 hours, 16 minutes ago -
Out of band for Windows 10
by
Susan Bradley
5 hours, 50 minutes ago -
Giving UniGetUi a test run.
by
RetiredGeek
12 hours, 47 minutes ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
20 hours, 24 minutes ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
18 hours, 23 minutes ago -
Auto Time Zone Adjustment
by
wadeer
1 day ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
22 hours, 33 minutes ago -
Manage your browsing experience with Edge
by
Mary Branscombe
3 hours, 9 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
14 hours, 5 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
18 hours, 22 minutes ago -
Apps included with macOS
by
Will Fastie
18 hours ago -
Xfinity home internet
by
MrJimPhelps
17 hours, 55 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
17 hours, 53 minutes ago -
Debian 12.11 released
by
Alex5723
1 day, 22 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
2 days, 1 hour ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
1 day, 5 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
21 hours, 34 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
2 days, 18 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 days, 9 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
6 hours, 45 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
2 days, 13 hours ago -
Some advice for managing my wireless internet gateway
by
LHiggins
1 day, 21 hours ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
23 hours, 4 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 days, 6 hours ago -
Sometimes I wonder about these bots
by
Susan Bradley
18 hours, 54 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
2 days, 17 hours ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
3 days, 20 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
2 days, 4 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.