Answer Ok to a MsgBox

Started by lindir, July 15, 2014, 08:50:09 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lindir

Hello guys!

I have a macro to drop shape on my visio drawing but for each shape a pop up appear and my code stop running.
The msgbox is an OK/cancel and and juste want to answer OK

Do you have an idea to automtically answer OK to a msgbox? or to avoid this msgbox from appear?

I try SendKeys {ENTER} but my code stop before reaching this command so it doesn't work :(

Thanks!!

Surrogate

Just delete code with msgbox  :)

Yacine

Yacine

lindir

Ahah wish it could be so simple..
The problem is that the MsgBox isn't in my code. Visio generetat it to aske me to do some settings on the shape I dropped with my code

Surrogate

try add time delay like as
    PauseTime = 5    ' Set duration.
    Start = Timer    ' Set start time.
    Do While Timer < Start + PauseTime
        DoEvents    ' Yield to other processes.
    Loop
        SendKeys "{F4}", True


lindir

#6
So much Thanks paul, I just add this line
Application.AlertResponse=1 

And all my problems are solved!


Merci!!

Paul Herber

#7
All of them?  Marvellous!!  :)
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

lindir

All of them for this macro at least!!
This line doesn't pay my rent unfortunately  ;D