2 Replies Latest reply on May 25, 2016 9:53 AM by pthivierge

    How to call the AF wrapper in Processbook VBA

    prshinde

      Hi,

       

      I have installed PI AF wrapper for processbook VBA.

      I need to know how i can call it in processbook VBA. How  can i get access to .NET commands in VBA..?

       

      Regards,

      Prasad

        • Re: How to call the AF wrapper inn processbook VBA
          John Messinger

          Have you looked at the WrapperExample.PDI file that came with the AF Wrapper? The VBA code in that file contains examples of calls to the AF Wrapper functions. Alternatively, have a peek at the wrapper.cs file that came as part of the Visual Studio solution to be compiled, and look for the public methods that are marked [ComVisible(true)]. These are the methods that are exposed to ProcessBook VBA.

          1 of 1 people found this helpful
          • Re: How to call the AF wrapper inn processbook VBA
            pthivierge

            Hello Prasad,

             

            The PI AF Wrapper for Processbook VBA is an example that demonstrates how to expose .NET code to VBA.

            To use it from VBA you will need to write the .NET code you need and re-register the wrapper.  It should become visible as a library from VBA and you can use it from there. 

            Using intellisense from VBA may be possible but you'd need to find tutorials to enable it, I would expect that you don't have it at the first place.

             

            If PI Web API is available, it may be an alternative.  I would invite you to refer to How to use PI Web API with VBA - Introduction to get started.

            This technique would have the advantage of keeping all your code in VBA, and you would not have to maintain the .NET part and register the add-in constantly.

             

            Let us know how it goes,

            1 of 1 people found this helpful