autoclick "ok" msgbox

  • Thread starter Thread starter jason
  • Start date Start date
Are you writing code that displays a prompt?

Lots of those verification prompts can be avoided by:

application.displayalerts = false
'your code here
application.displayalerts = true

If this doesn't help, you may want to describe your situation in greater detail.
 
is this possible?
thanks!

Hi Jason.
I hope you understand what means the Dave's answer.:-))
However, try:

Public Sub Msgout()
Const iSec As Long = 3
Const msg As String = "This may be a no sense message; Ciao!"
Dim titolo As String
titolo = "Il messaggio si chiude dopo " & iSec & " secondi"
CreateObject("WScript.Shell").Popup msg, iSec, titolo
End Sub

Regards
Eliano
 
Just to add to Eliano's response.

The suggested code actually uses a "self-dismissing" msgbox. It's not
dismissing a msgbox that excel shows (or the developer used).

And it seems to work in some versions of windows (no problems with winXP Home
and xl2003 for me). Not so well in other versions of windows.
 
Just to add to Eliano's response.

The suggested code actually uses a "self-dismissing" msgbox.  It's not
dismissing a msgbox that excel shows (or the developer used).

And it seems to work in some versions of windows (no problems with winXP Home
and xl2003 for me).  Not so well in other versions of windows.









--

Dave Peterson- Nascondi testo citato

- Mostra testo citato -

Hi Dave.
Many, many thanks for the news, I use XL2003.
However I specify: [message no sense] because the reason to insert a
msgbox in a macro, means that a reply from the user would be
considered necessary.
In accordance with your first answer, no action required, no message.
Sorry for my poor english and regards
Eliano
 
Not all messages to users need to get a response from the user. I use the
statusbar to show stuff that the user may be interested in.

And lots of dialogs are redundant--I'm sure you've seen dialog boxes that allow
you to set an option to never see this dialog again.

But more importantly, not all code can be changed by the user. The original
poster may not be the author of the code.

eliano wrote:
Hi Dave.
Many, many thanks for the news, I use XL2003.
However I specify: [message no sense] because the reason to insert a
msgbox in a macro, means that a reply from the user would be
considered necessary.
In accordance with your first answer, no action required, no message.
Sorry for my poor english and regards
Eliano
 
Are you writing code that displays a prompt?

Lots of those verification prompts can be avoided by:

application.displayalerts = false
'your code here
application.displayalerts = true

If this doesn't help, you may want to describe your situation in greater detail.

Hey Dave,

I get what you're saying. Basically, i am using vba to speak with some
proprietary data gathering software.
this data takes a little while to populate, and with this, i have
realized that a msgbox dialog looped with a strcomp (if match flag=0
else flag =1) that hits a flag (ie if flag=1 exit loop) and the match
occurs when data is still being gathered.

cells(1,1)=data gather reference
do while strcomp(cells(1,1),"Gathering Data...",vbtextcompare)=0
msgbox("Gathering data please wait...")
if strcomp(cells(1,1),"Gathering Data...",vbtextcompare)<>0
sendkeys "~"
end if
loop

basically, sendkeys isn't working. its more like a status msg. if i
can use a different kind of msg that is better, please let me know.
i just basically want the msgbox to come up and be a type of status
msg.


thanks!
 
You could design your own userform and show it while the process is running.

But lots easier is to use:

application.statusbar = "Gathering Data..." & now
....do more stuff
application.statusbar = "Processing data..." & now
....do more stuff
application.statusbar = false 'give it back to excel

Make sure that the statusbar is visible and that the user knows where to look.
 
Not all messages to users need to get a response from the user.  I use the
statusbar to show stuff that the user may be interested in.

And lots of dialogs are redundant--I'm sure you've seen dialog boxes thatallow
you to set an option to never see this dialog again.

But more importantly, not all code can be changed by the user.  The original
poster may not be the author of the code.  

eliano wrote:

<<snipped>>


Hi Dave.
Many, many thanks for the news, I use XL2003.
However I specify: [message no sense] because the reason to insert a
msgbox in a macro, means that a reply from the user would be
considered necessary.
In accordance with your first answer, no action required, no message.
Sorry for my poor english and regards
Eliano

Hi Dave.
When I speak of "messagge" I refer to Msgbox, not to some necessary or
useful informations for the user,
The statusbar is a valid method, but the opinion of many users is that
the statusbar have a low visibility and in case of long elaborations I
use to send informations directly in a cell of the worksheet, but
never msgboxs.
Thanks again and regards
Eliano
 
You could design your own userform and show it while the process is running.

But lots easier is to use:

application.statusbar = "Gathering Data..." & now
...do more stuff
application.statusbar = "Processing data..." & now
...do more stuff
application.statusbar = false 'give it back to excel

Make sure that the statusbar is visible and that the user knows where to look.





jasonwrote:

hey dave,
i am using the msgbox functionality for a reason (it offers a tpye of
"break").
so with this, i just need what i asked, not a different solution.
thanks!
 
Good luck.
hey dave,
i am using the msgbox functionality for a reason (it offers a tpye of
"break").
so with this, i just need what i asked, not a different solution.
thanks!
 
Back
Top