ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Timed Message Box (https://www.excelbanter.com/excel-discussion-misc-queries/124371-timed-message-box.html)

FARAZ QURESHI

Timed Message Box
 
What macro should be assigned to a message box to pop up upon opening a
workbook displaying company logo and disappearing in 2 seconds?

Jim Rech

Timed Message Box
 
Sub SelfClosingMsgBox()
Dim wsh As Object
Set wsh = CreateObject("WScript.Shell")
wsh.Popup "Hello!", 2, "This closes itself in 2 seconds"
End Sub


--
Jim
"FARAZ QURESHI" wrote in message
...
| What macro should be assigned to a message box to pop up upon opening a
| workbook displaying company logo and disappearing in 2 seconds?



vcff

Timed Message Box
 
Hi Jim Rech
This is also what I need so I copied the macro to under the view code "this
workbook' but it open without the msg. Can you provide more info.
tnks.

"Jim Rech" wrote:

Sub SelfClosingMsgBox()
Dim wsh As Object
Set wsh = CreateObject("WScript.Shell")
wsh.Popup "Hello!", 2, "This closes itself in 2 seconds"
End Sub


--
Jim
"FARAZ QURESHI" wrote in message
...
| What macro should be assigned to a message box to pop up upon opening a
| workbook displaying company logo and disappearing in 2 seconds?




Dave Peterson

Timed Message Box
 
Rename the subroutine
Sub Workbook_Open()

This'll run when the workbook is opened (and your users allow macros to run).

vcff wrote:

Hi Jim Rech
This is also what I need so I copied the macro to under the view code "this
workbook' but it open without the msg. Can you provide more info.
tnks.

"Jim Rech" wrote:

Sub SelfClosingMsgBox()
Dim wsh As Object
Set wsh = CreateObject("WScript.Shell")
wsh.Popup "Hello!", 2, "This closes itself in 2 seconds"
End Sub


--
Jim
"FARAZ QURESHI" wrote in message
...
| What macro should be assigned to a message box to pop up upon opening a
| workbook displaying company logo and disappearing in 2 seconds?




--

Dave Peterson


All times are GMT +1. The time now is 10:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com