2 Replies Latest reply on Apr 3, 2009 2:06 PM by dhollebeek

    Add VBA code to PB Display from .NET addin

    AlistairFrith

      Is it possible to manipulate the VBA modules in a processbook display from a .NET addin?

       

      Basically, I am creating an addin that will build displays and want the addin to put some functionality behind some of the static objects it creates. So I need to do the following from within the .NET addin:

      1. Import a pre-built VBA module
      2. Make some of the basic symbols on the display scriptable
      3. insert code behind the click events of these symbols to call the functions in the VBA module with specific parameters.

      In VBA, I would do something like

       

      Dim myVBE as VBE
        set myVBE = Application.VBE
        with myVBE.CodePanes.Item(1).CodeModule
          'do stuff
      End With

       

      but in .NET, it does not know what 'VBE' is and I can't see an obvious reference to add.

       

      The generated displays will be viewed through ActiveView. I could probably build a separate .NET addin to provide the functionality but I don't want to force the users to download addins. Also, would I not still have to put code behind the symbols to call the addin?

       

      --- Alistair.