AnsweredAssumed Answered

Does ProcessBook need focus when executing VBA Scripts? (Based off the state of MultiState Symbols)

Question asked by bclake Champion on Feb 2, 2015
Latest reply on Feb 23, 2015 by bclake

I've got some basic ProcessBook VBA that works consistently during testing and while running on machines that aren't touched, but on machines that are utilized regularly (but leave PB up in the background) the VBA does not seem to be triggered.   Anyone had similar experiences with this, or guesses as to why it might happen?

 

I even added some code in the VBA for logging and it seems like either I'm missing something in the trigger logic (that always works during testing) or there is some sort of issue with the VBA not getting triggered by a multi-state switch when ProcessBook is running in the background.

 

Any insight, or suggestions on other ways to test would be great.

 

Thanks!
Brandon

 

 

Extra Detail:

The code that I want to trigger, and I'm worried is not getting triggered:

 

Private Sub HA1_Zone1_StateChanged(bCancelDefault As Boolean)

Sleep (1000)

If (HA1_Zone1.GetMultiState.CurrentState > 1) Then Play_Sound Else No_ActionLogWrite

End Sub

 

HA1_Zone1_StateChanged is a multistate symbol, with only 2 states.  And it successfully triggers when I'm looking at ProcessBook.  Play_Sound works during testing, and No_ActionLogWrite is just putting some text into a notepad file.

Outcomes