If I have a public object declared in the VBA-code in a display (PDI), a reference object, it's working great, a while, but suddenly it's lost and I have to restart the display. What's wrong then?
In my experience, the VBA environment has the nasty habit of occasionally resetting itself and clearing out the global variables.
I've never really been able to pin down when it happens - possibility due to some error condition or exception occurring in the underlying application (eg Excel or ProcessBook).
Does this behavior coincide with something else happening? Are people interacting with the display or code? Or does it just "happen"?
EDIT: Google "vba loses global variables" and you'll find quite a few articles about the behavior. It seems the issue often boils down to poor exception handling.
It happens every now and then but this displays are in a development stage so no users yet. I've changed
to local object everywhere I can just in case. Will try to pay more attention next time it happens
Från: Ian Gore
Skickat: den 25 mars 2015 14:32
Till: Dohrman Anders (Sogeti)
Ämne: Re: - Loses public objects in a display (PDI)
PI Square <https://pisquare.osisoft.com/?et=watches.email.thread>
Loses public objects in a display (PDI)
reply from Ian Gore<https://pisquare.osisoft.com/people/Ian.Gore?et=watches.email.thread> in General Programming Languages - View the full discussion<https://pisquare.osisoft.com/message/44535?et=watches.email.thread#44535>
Retrieving data ...