Solved

Message in Excel VBA

Posted on 2014-01-03
7
363 Views
Last Modified: 2014-01-03
I want to show a message as below when users hit a button to trigger VBA running, but it seems that users had to click "OK" button inside the message box in oder to run VBA.  Is there anyway that VBA can run and the message can stay until done?  Thanks!

MsgBox ("please wait a moment, this process can take up to 15 seconds")
0
Comment
Question by:jjxia2001
  • 4
  • 2
7 Comments
 
LVL 13

Assisted Solution

by:Alexander Eßer [Alex140181]
Alexander Eßer [Alex140181] earned 50 total points
ID: 39755170
This is from http://www.tek-tips.com/faqs.cfm?fid=4699:
[...]Message boxes are always modal, which means that the underlying application (e.g. Excel) waits for a response from the User[...]

It's well described how to get this stuff working ;-)

[...]One option is to use the Message Box facility directly, via the Windows API, instead of via the VBA interface.[...]
0
 
LVL 13

Assisted Solution

by:Alexander Eßer [Alex140181]
Alexander Eßer [Alex140181] earned 50 total points
ID: 39755173
or you may want to use the status bar instead, like
Application.StatusBar = "Please be patient..."
Application.StatusBar = iDone & " of " & iTotal & " items done."

Open in new window

0
 

Author Comment

by:jjxia2001
ID: 39755204
[...]One option is to use the Message Box facility directly, via the Windows API, instead of via the VBA interface.[...]

How to do it?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 12

Accepted Solution

by:
Jeff Darling earned 450 total points
ID: 39755210
Here is a sample that does what you want using a form as a dialog
WaitDialogExample.xlsm
0
 
LVL 13

Expert Comment

by:Alexander Eßer [Alex140181]
ID: 39755253
[...]One option is to use the Message Box facility directly, via the Windows API, instead of via the VBA interface.[...]

How to do it?

Great :-(
The link, I PROVIDED (http://www.tek-tips.com/faqs.cfm?fid=4699) exactly describes HOW TO DO IT ;-) Did you even open that link?!?
I am truly not after the point, BUT this is defintely not how EE should work!

Kind regards,
Alex
0
 

Author Comment

by:jjxia2001
ID: 39755277
Alex,

Yes, I opened the link, but I had to spend time to figure out.  But when I coped and pasted the other sample, it worked immediately.  Anyway I really appreciate your helps!
0
 
LVL 13

Expert Comment

by:Alexander Eßer [Alex140181]
ID: 39755286
I don't want to be too offensive now and I surely do not want to bother you, but do you really think, you're going to learn anything by just "copy & paste"?!

Anyways... I'm quite sure, you know what you're doing ;-)
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This article will show you how to use shortcut menus in the Access run-time environment.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now