Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

Launch macro from ProcessBook custom Add-in

$
0
0

Goodevening dear PI community !

 

I'm having some difficulties with a piece of code, so maybe that one of you could help me... ?

 

I'd like to build a custom Add-in for PI. To do so, I have followed the explanations from a very nice video in YouTube, that you can find at the following link :

http://www.youtube.com/watch?v=VCciQMQxsUQ

 

And my problem is the following : I would like that my add-in adds a custom menu to the "Display Menu Bar", and in this menu, some commands should launch a piece of macro embedded in my custom add-in.

 

I can add the custom menu with the following command

 

Set MenuName = PBObjLib.Application.CommandBars.Item(3)

Set NewMenu = MenuName.Controls.Add(pbControlButton)

 

Then I would like to give some properties to my new button :

 

With NewMenu

   .Caption = "Hello" 

   .onAction = Test_Macro

End With

 

 

The addition of the custom menu works fine, but here is the problem : what should I specify after the "onAction" to launch the macro called "Test_Macro" that is embedded in the add-in ? If I just give the name of the macro, it does not work, the macro can not be found...

 

I have tried several codes such as :

.onAction = application.run("MyAddin.dll!Test_Macro")

 

But it does not work either...

 

Any idea ?

 

Thank you very much in advance for your help !

 

Vincent


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>