Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

VBA code to force ProcessBook to open another file

$
0
0

Hi,

 

I am trying to use a code to force processbook to open a file in my server.

 

The users are copying the files from server to their local PC and doing changes on display, and I lose control over the changes.

 

The code I tried using is:

Private Sub Display_Open()

Const path = "\\myserver\processbook\display1.pdi"

Dim d1

    If ThisDisplay.Path <> path Then
    
    Application.ActiveDisplay.Close (True)
    
    Set d1 = Application.Displays.Open("\\myserver\processbook\display1.pdi", True)

End If


End Sub

 What I need: when the user open the file in their PC, the code run and open the display saved in the server and close the display saved in their PC... But when a run the code above, the display is closed and the other display doesn´t open.

 

Have you any idea?

 

Thanks

Allan


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>