3 Replies Latest reply on Feb 28, 2019 5:29 PM by gregor

    in Processbook VBA, how do I disable an object library reference that is in use?

    gfmalek

      I have two .pdi files.  I want to run a very simple line of code --> "MsgBox ThisDisplay.Symbols(1).Name".  In one of the .pdi files it works perfectly fine and prints the symbol's name.  In the other .pdi file, it gives the following error:

       

      Compile error:

       

      Object library invalid or contains references to object definitions that could not be found.

       

      I viewed Tools >> References for both .pdi files.  The working .pdi file has the following references checked:

      Visual Basic For Applications

      OLE Automation

      PI-Processbook Type Library

      PI-Processbook Symbol Library.

       

      The non-working .pdi display has those four checked, plus a fifth one titled "Microsoft Forms 2.0 Object Library."  I tried to uncheck this reference but received "Can't remove control or reference; in use".

       

       

       

      Does this References discrepancy explain why one .pdi display executes the macro just fine and the other doesn't?  And if so, how do I get the dysfunction display to execute VBA code if I can't disable the reference that's causing problems?

       

      Thanks for your help.

        • Re: in Processbook VBA, how do I disable an object library reference that is in use?
          gregor

          Hello Gregory,

           

          Gregory Malek wrote:

          Compile error:

           

          Object library invalid or contains references to object definitions that could not be found.

          Even KB00804 - VBA Errors in Microsoft Excel is for Excel and not for ProcessBook, I believe it is sufficient. Please see if you can find any EXD files and delete them. If this doesn't work, it would be helpful to know which control the one with index 1 is.

           

          Gregory Malek wrote:

           

          I viewed Tools >> References for both .pdi files. The working .pdi file has the following references checked:

          Visual Basic For Applications

          OLE Automation

          PI-Processbook Type Library

          PI-Processbook Symbol Library.

           

          The non-working .pdi display has those four checked, plus a fifth one titled  I tried to uncheck this reference but received "Can't remove control or reference; in use".

           

           

           

          Does this References discrepancy explain why one .pdi display executes the macro just fine and the other doesn't? And if so, how do I get the dysfunction display to execute VBA code if I can't disable the reference that's causing problems?

           

          You cannot uncheck "Microsoft Forms 2.0 Object Library." because the PDI has a control from this library. I don't believe that the original issue is because of the Microsoft Forms 2.0 Object Library. Potentially the issue is with a control from this library.