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

VB Macro Call Using Java API Invoke function throwing error

FM_MEGA
Super Contributor

We have a requirement to call VB macro from Java code

I am using following code to invoke a function "printme" inside a macro named myTestMacro

 

MegaObject myMacroObj=mgRoot.getObjectFromID("~kJbFxI4oO5EN");// to get myTestMacro
if (myMacroObj != null && myMacroObj.exists()){
MegaCOMObject thisMacroFromRoot =(MegaCOMObject)mgEnvironment.getMacro(myMacroObj.getProp("~210000000900[Name]"));
thisMacroFromRoot.invokeFunction("printme");

 

I am getting following error :

 

Exception in thread "main" MEGA Error 0x80020101
at com.mega.modeling.api.jni.MappModuleJNI.InvokeFunction(Native Method)
at com.mega.modeling.api.jni.ComObjectProxy.invokeFunction(Unknown Source)

 

Can some one help me what am I missing here. Thanks in advance.

1 Reply

FM_MEGA
Super Contributor

Can some one please give some insight ?