Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default MsgBox Closes Automatically


Excel Experts,

Is there any way to close a message box without the user having to click "OK".

I want to show a message t other user for a few seconds and then have the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default MsgBox Closes Automatically

You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to click "OK".

I want to show a message t other user for a few seconds and then have the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default MsgBox Closes Automatically

Dave,

Thanks for the help.

Alan

--
achidsey


"Dave Peterson" wrote:

You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to click "OK".

I want to show a message t other user for a few seconds and then have the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default MsgBox Closes Automatically

I tried it, but it doesn't close.
Can I just put this straight in a Sub without anything else?

RBS

"Dave Peterson" wrote in message
...
You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to click
"OK".

I want to show a message t other user for a few seconds and then have the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add
code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey


--

Dave Peterson


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default MsgBox Closes Automatically

When I save the workbook, close Excel, and try it again it works.
Thanks for the tip; will see if I have some use for it.

RBS


"RB Smissaert" wrote in message
...
I tried it, but it doesn't close.
Can I just put this straight in a Sub without anything else?

RBS

"Dave Peterson" wrote in message
...
You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to click
"OK".

I want to show a message t other user for a few seconds and then have
the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add
code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default MsgBox Closes Automatically

I've seen posts that say that the message box doesn't close for them.

IIRC, it was a different version of windows that caused the trouble. If it
doesn't work for you, then I don't think that there's any tweak you can make to
it.

RB Smissaert wrote:

I tried it, but it doesn't close.
Can I just put this straight in a Sub without anything else?

RBS

"Dave Peterson" wrote in message
...
You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to click
"OK".

I want to show a message t other user for a few seconds and then have the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add
code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default MsgBox Closes Automatically

I read other posts saying that the timing wasn't always reliable, so I think
I won't use this.
Maybe the best way is with the API. A userform will be simpler, but it seems
a lot of resources
for a simple message box.

RBS

"Dave Peterson" wrote in message
...
I've seen posts that say that the message box doesn't close for them.

IIRC, it was a different version of windows that caused the trouble. If
it
doesn't work for you, then I don't think that there's any tweak you can
make to
it.

RB Smissaert wrote:

I tried it, but it doesn't close.
Can I just put this straight in a Sub without anything else?

RBS

"Dave Peterson" wrote in message
...
You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to
click
"OK".

I want to show a message t other user for a few seconds and then have
the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add
code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey

--

Dave Peterson


--

Dave Peterson


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default MsgBox Closes Automatically

Yes there was a long thread last summer (do doubt others too). Although it
worked for some, not at all for others (incl me), and spasmodically for
others (irregular times). There wasn't any obvious commonality in systems in
which it worked or otherwise. The consensus was not reliable for general
distribution.

Regards,
Peter T

"Dave Peterson" wrote in message
...
I've seen posts that say that the message box doesn't close for them.

IIRC, it was a different version of windows that caused the trouble. If

it
doesn't work for you, then I don't think that there's any tweak you can

make to
it.

RB Smissaert wrote:

I tried it, but it doesn't close.
Can I just put this straight in a Sub without anything else?

RBS

"Dave Peterson" wrote in message
...
You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to

click
"OK".

I want to show a message t other user for a few seconds and then have

the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add
code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey

--

Dave Peterson


--

Dave Peterson



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default MsgBox Closes Automatically

Hi Peter,

Have come to the same conclusion, but I can't really see any use for it in
any case.

RBS

"Peter T" <peter_t@discussions wrote in message
...
Yes there was a long thread last summer (do doubt others too). Although it
worked for some, not at all for others (incl me), and spasmodically for
others (irregular times). There wasn't any obvious commonality in systems
in
which it worked or otherwise. The consensus was not reliable for general
distribution.

Regards,
Peter T

"Dave Peterson" wrote in message
...
I've seen posts that say that the message box doesn't close for them.

IIRC, it was a different version of windows that caused the trouble. If

it
doesn't work for you, then I don't think that there's any tweak you can

make to
it.

RB Smissaert wrote:

I tried it, but it doesn't close.
Can I just put this straight in a Sub without anything else?

RBS

"Dave Peterson" wrote in message
...
You could use something like:

CreateObject("WScript.Shell").Popup "Hello", 4, _
"This closes itself in 4 seconds"



achidsey wrote:

Excel Experts,

Is there any way to close a message box without the user having to

click
"OK".

I want to show a message t other user for a few seconds and then
have

the
message box disappear without the user having to click the OK
button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to
add
code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey

--

Dave Peterson


--

Dave Peterson




  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default MsgBox Closes Automatically

Yes there was a long thread last summer

To prevent complaints of geographical ambiguity, I wrote that in the
northern hemisphere!

Regards,
Peter T

"Peter T" <peter_t@discussions wrote in message
...
Yes there was a long thread last summer (do doubt others too). Although it
worked for some, not at all for others (incl me), and spasmodically for
others (irregular times). There wasn't any obvious commonality in systems

in
which it worked or otherwise. The consensus was not reliable for general
distribution.

Regards,
Peter T

"Dave Peterson" wrote in message
...
I've seen posts that say that the message box doesn't close for them.

IIRC, it was a different version of windows that caused the trouble. If

it
doesn't work for you, then I don't think that there's any tweak you can

make to
it.

<snip




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default MsgBox Closes Automatically

Hi,

Add a userform.

Put a label in the Userform that has the message you want ("No New Shorts")

Then add this code to the userform activate event

Private Sub UserForm_Activate()

MyNumber = Timer

Do Until MyNumber + 5 < Timer

DoEvents

Loop

UserForm1.Hide

End Sub

That will display the message for about 5 seconds.

=============

In your main code add this

UserForm1.Show

To display the userform.

Best of Luck,

Joe

"achidsey" (notmorespam) wrote in message
...

Excel Experts,

Is there any way to close a message box without the user having to click
"OK".

I want to show a message t other user for a few seconds and then have the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey



  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default MsgBox Closes Automatically

Here is a way to do this with the Windows API:
http://www.xcelfiles.com/API_02.html

RBS

"achidsey" (notmorespam) wrote in message
...

Excel Experts,

Is there any way to close a message box without the user having to click
"OK".

I want to show a message t other user for a few seconds and then have the
message box disappear without the user having to click the OK button.

My code is similar to the following:

Sub EnterNewShorts()

Set NewShorts = Cells.Find(What:="NewShort")

If NewShorts Is Nothing Then

MsgBox "No New Shorts"
Exit Sub

Else
(rest of code)

End Sub

I know how to pause the code for a few seconds. Then I'd like to add code
that closes the message box. Is this possible?

Thanks,
Alan

--
achidsey


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel closes PaulaC Excel Discussion (Misc queries) 2 December 12th 07 04:41 PM
EXCEL CLOSES A.Oz Excel Worksheet Functions 2 July 6th 07 10:28 AM
Closes Excel Rob Excel Discussion (Misc queries) 0 April 20th 07 08:11 PM
Excel closes automatically when opened [email protected] Setting up and Configuration of Excel 2 January 4th 07 08:51 PM
Hiding, or automatically answering, a confirmation msgbox Brian Beck Excel Discussion (Misc queries) 1 July 28th 06 04:11 PM


All times are GMT +1. The time now is 12:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"