Solved

Message in Excel VBA

Posted on 2014-01-03
7
383 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Create Professional Looking Email Signatures

Create "Professional HTML Email Signatures" with ease.
7 Day Money Back Guarantee if not 100% Satisfied.
Affordable - Try it out for 7 Days Totally Risk Free.
Installers provided for over 45 Email clients.
Both Windows & MAC Supported.
Highly Recommended!

 
LVL 13

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

Create Professional Looking Email Signatures

Create "Professional HTML Email Signatures" with ease.
7 Day Money Back Guarantee if not 100% Satisfied.
Affordable - Try it out for 7 Days Totally Risk Free.
Installers provided for over 45 Email clients.
Both Windows & MAC Supported.
Highly Recommended!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

734 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