auto Clicking botton through macro

151 Views Asked by At

i want to run list of macros one by one in Catia , while running every macro it displays message box . to continue next macro i am clicking ok or close button on msg box to close. until i close the message box the next macro is not running.

i want to click ok or cancel buttons on msg box or user frame automatically through scripting or macro.so my list of Catia macros will run continuously without any manual click.

is it possible to click button through macro on user forms which are displaying

2

There are 2 best solutions below

4
JMan On

If you want to have some functionality continual, wouldn't be better to just write all the functionality into the one macro and start it?

You can virtually click on buttons by SendKey function ,but based on my experience it may not be reliable.

I would recommend, and by my opinion this is the easiest way, just copy each macro to a separate classes with some static method to run it and the just call it one by one from the module with CATMain function.

0
El doctor Sertato On

You can ask the user to choose the operating mode at the start of the macro. Then bypass the following box messages.

Sub catmain()

Dim StepByStep As VbMsgBoxResult
StepByStep = MsgBox("Do you want launch Macros step by step ?", vbYesNo, "Macro mode")

.
.
.

If StepByStep = vbYes Then
    MsgBox "Result MAcro 1", vbExclamation, "Result"
End If

End Sub