Hi friends , I tried to search a macro to press OK or NO or CANCEL automatically after a msgbox that I created but I did not find something like this. can somone help me ? . thank you
Did you referred to similar post of yours here: https://forum.solidworks.com/message/747121#comment-747121
What issues are you facing?
Yeah , When the msgbox appear , for exemple you should press manually OK or NO !! I do not want to select OK or NO manually but automatically with macro or command !
Not sure if you can do it because message box is "modal" and stop code execution; however, you can close the message box in time (this can be done easy in .NET - but I'm not sure about VBA - should be the same ...)
Not sure exactly your question. I guess you want to use vbYesNoCancel where "Yes" can be used as "OK"
No , when for example I excute : Msgbox(" Hi ! ") , a small widows appear and in this time and should select OK to exit it , so my question how can I select OK to exit it automatically without press OK manually. thanks
Internet is your friend, I just searched and found these two:
Is it possible to programmatically close a MsgBox? - Microsoft Access / VBA
Automatically Dismiss a Message Box
thank you very much , you too , you are my friend
I tried to use your lnks but Its not what I like to do . I want to autoclick OK when a msgbox windows appear.thanks
The super easy way is to crate your own message box in the "form" format, then you can do whatever you want !
thank you myfriend
As I mentioned in other reply, you can create your own mesgbox such as a form with few buttons on it so you can easy manipulate the form without adding any extra window API calls to close it
I understand you but I don't have an idea how to create something like this !
If you have a custom message box in for "form" format, then you just simply close the form like "unload me"
Automatically dismissing a MsgBox is more difficult that creating your own form. If you cannot create a form, you cannot write the code to dismiss a message box.
You can install a separate program that can click message boxes for you. It's called "PTFB": Macro Recorder and Mouse Auto Clicker
Retrieving data ...