MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 29th, 2003, 05:59 PM   #1
Senji
 
Join Date: Mar 2002
Posts: 32
Default Msgbox that disappears after a few seconds? is it possible?

Trying to be funny and want my little macro to pause for like 5 to 10 seconds with the message Processing.... in a msgbox and then to disappear after the timer is up without pressing a key, is that possible?

Thanks
Senji is offline   Reply With Quote
Old May 29th, 2003, 06:02 PM   #2
Juan Pablo González
MrExcel MVP
 
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,700
Default Re: Msgbox that disappears after a few seconds? is it possi

Yes, possible... and asked quite a few times as well...

The options are from the very simple of having a textbox from the drawing toolbar displayed in the sheet, and hide it with the macro to the complicated ones (Coded by Ivan F Moala) that uses some API calls to dismiss the MsgBox automatically.

Just a matter of how 'fancy' you want to go...
__________________
Regards,

Juan Pablo González
Juan Pablo González is offline   Reply With Quote
Old May 29th, 2003, 06:06 PM   #3
kskinne
 
kskinne's Avatar
 
Join Date: Feb 2002
Location: USA
Posts: 1,261
Default Re: Msgbox that disappears after a few seconds? is it possi

I got this off the board and it works well for me with the workbook_open event:

Code:
CreateObject("WScript.Shell").Popup "Place message here", 3, "Message Title"
the '3' signifies three seconds, the amount of time before the popup closes, unless you close it manually by clicking the ok button

hth
kevin
kskinne is offline   Reply With Quote
Old May 29th, 2003, 06:23 PM   #4
Senji
 
Join Date: Mar 2002
Posts: 32
Default Re: Msgbox that disappears after a few seconds? is it possi

Basically, what I have written right now is something I threw together in 15 minutes... they open up a spreadsheet, there is a button that says Push Me for Quote or Purchase Order Number....

they push it
1) it asks for Company Name(for quote or po)
2) then their name
3) Quote or PO?

This is all done with InputBox presently. Then displays the next number available for quote/po...

I just want it to pause for 5 or 10 seconds.... in a box that says...

Processing.....


then the box can either change it wording and display the number to use
or just disappear and open the next msgbox in the macro...

any ideas where to get that type of code or understanding of which to use?
Senji is offline   Reply With Quote
Old May 29th, 2003, 07:28 PM   #5
Smitty
MrExcel MVP
Moderator
 
Smitty's Avatar
 
Join Date: May 2003
Location: Boulder Creek, CA
Posts: 18,286
Default Re: Msgbox that disappears after a few seconds? is it possi

You can build a User Form that displays your "Processing..." dialogue in the caption, in the code put:

Private Sub UserForm_Initialize()

lblMessage.Caption = Processing_Message

End Sub

Private Sub UserForm_Activate()

Me.Repaint
Application.Run Macro_to_Process
Unload Me

End Sub

Then Insert a module and put:

Public Processing_Message As String
Public Macro_to_Process As String

Sub StartProcessing(msg As String, code As String)

Processing_Message = msg

Macro_to_Process = code

Processing_Dialog.Show

End Sub

Sub MyMacro()

For x = 1 To 50000
Application.StatusBar = x

Next

Application.StatusBar = False

End Sub
Sub Main()
StartProcessing "I'm Working On It! Just Hang On!", "Update_Now"
End Sub

I got that one from Microsoft a few years ago when they still gave out help...
Smitty is offline   Reply With Quote
Old Jun 25th, 2009, 11:34 PM   #6
taigovinda
 
Join Date: Mar 2007
Posts: 124
Default Re: Msgbox that disappears after a few seconds? is it possi

Hi,

I am trying to make this work and wondering why it doesn't go away after a few seconds.

Code:
Sub test()

CreateObject("WScript.Shell").Popup "Place message here", 3, "Message Title"
End Sub
Any ideas?

Thanks!

Tai

Quote:
--------------------------------------------------------------------------------

I got this off the board and it works well for me with the workbook_open event:


Code:
CreateObject("WScript.Shell").Popup "Place message here", 3, "Message Title"the '3' signifies three seconds, the amount of time before the popup closes, unless you close it manually by clicking the ok button

hth
kevin
taigovinda is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 11:44 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2009 by MrExcel Consulting.