This is weird because if I execute the VBA code in my machine, it works as expected. I am using ProcessBook version 3.2, are you using the same version?
I think the Add method does support an optional 2nd parameter, which is meant to take in the ProgID of controls if you are attempting to use the method to add a control to the display. What if you specify Null as a 2nd parameter explicitly?
It is version 126.96.36.199, and I consistently get the message listed above. I also tested by using another PDI file and simply pasting in a few lines of code.. no change.
Alex - something must be wrong with your installation.
I have tried your code and it works fine (as expected) - can you check the references in PB - what references are added to your VBA Project?
Can you look for the file PIPC\Procbook\PBSYMLIB.tlb, size and date
And PIPC\Procbook\PBOBJLIB.tlb, size and date?
Can you try the following (just for test):
Dim oValue As Object Set oValue = Me.Symbols.Add(7) oValue.SetTagName ("SINUSOID")
Hmmm... curiouser and curiouser....
Used the code sample you gave... worked fine.
Changed my code to read:
Dim oValue As Object
Set oValue = Me.Symbols.Add(pbSymbolValue)
where sAliasValue is the tag reference in the format \\server\tag, but still got an error.
Changed the tag to "sinusoid", and it worked.
So, changed it back to my code as shown above and it started working...