As far as I know, I don't think it is possible to do that with Processbook VBA. There are similar questions in the net about compiling and running Excel VBA outside Excel and it can be done with something like:
path = CreateObject(”WScript.Shell”).CurrentDirectory
Set appXL = CreateObject(”Excel.Application”)
Set objWb = appXL.Workbooks.Open(path & “\db\excel.xls”)
appXL.Application.Run objWb.Name & “!” & “showform”
But similar method would not work for Processbook it is implemented differently.
This is a nice enhancement request that I suggest you file in at Tech Support. That way it will be archived in the system and will be considered by the development teams and product managers.
Wouldn't it be possible for you to have a macro call the add-in function and then call the macro from within there?
if the add-in has a public method that returns a value you could then react to that returned code inside the first macro to call a second macro accordingly.
But I think the other way around would be really hard.
Directly within VBA, no, but with some trickery yes.
In a nutshell what you need to do is use Visual Basic Extensibility so you can add and remove VBA methods to/from the VBProject for "ThisDisplay" then use ProcessBook symbol manipulation to finish off the process. You add a symbol dynamically to the display, enable scripting, set Visible property to false, use VBE to add a method signature for one of the symbol's events (e.g. the Click event) and trigger the event. Within the symbols event you add code that simply calls the public sub that you want to call from your addin.
Public Sub MySymbol_Click(ByVal lvarX As Long, ByVal lvarY As Long)
Once the symbols event has finished you simply remove the method using VBE and remove the symbol (additionally you could set ThisDisplay.Modified = False so it appears to happen silently).
Not straight forward but there is always a solution
Give me a shout if you want a .Net method to do it, I have it somewhere in my archives.
Nice one, Rhys =]