Solved

Message in Excel VBA

Posted on 2014-01-03
7
365 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
excel pivot question 4 40
Excel case statements 3 24
Merging-Splitting-Multiple-Rows 33 42
Excel Automation VBA 19 30
This article will show you how to use shortcut menus in the Access run-time environment.
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

911 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

20 Experts available now in Live!

Get 1:1 Help Now