cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calling a Macro From API

mostafafad
Super Contributor

Dear Community,

 

 

I am trying to call a Macro from API.

 

I tried using the below but didn't succeed. Any advise?

 

 

mMacros = mI.MyRoot.GetCollection("Macro")

oMacro = mMacros.Item("AutomateMacroExecute")

oMacro.CallMethod("Execute")

 

 

Thank You

Mostafa

1 Reply

yjestin
Super Contributor

Hi Mostafa,

 

You can try this :

Set myTrigger = MegaEnv.GetMacro("myMacro")
myTrigger.myCommand myParam1, myParam2

with myMacro code is like :
Sub myCommand (myParam1, myParam2)
 ...
End Sub

 

Regards

Yannick