2 Replies Latest reply on Apr 5, 2017 12:23 PM by Tyler.Camp

    PI Processbook Embedded Link Issue

    Tyler.Camp

      I have followed the steps here:

      How to automatically update a embedded object (MS Excel) in a Processbook PDI file whenever the PDI file is opened?

       

      With some minor tweaks, I was able to update the embedded object on a 10 minute cycle. This is working on my computer and another users computer.

       

      With two other users, after they launch the PI program it directly opens the excel sheet and then continues to loop the process.

       

      With my computer and the user with no issue, PI is loaded and then "updating ActiveX objects" screen pops up. After that PI goes into normal function and every 10 minutes it will update the excel object.

       

      I have gone onto the others computers and checked the PI connection manager and ProcessBook Preferences, all of which match my settings. Also, we are all opening the book from the same location within a shared drive.

       

      Below is the code in VBA used to start the refresh.

       

      Private Sub UpdateEmbededWorkbooks()

              Dim ExApp As New Excel.Application

              ExApp.Visible = False

              Dim WB As Excel.workbook

              Set WB = ExApp.Workbooks.Open("excelfilename") (not the real location name)

              ExApp.Quit

              Set WB = Nothing

              Set ExApp = Nothing

      End Sub

      Private Sub Display_DataUpdate()

          Debug.Print Second(Now)

          If Minute(Now) = 10 And Second(Now) < 15 Then

              UpdateEmbededWorkbooks

          ElseIf Minute(Now) = 20 And Second(Now) < 15 Then

              UpdateEmbededWorkbooks

          ElseIf Minute(Now) = 30 And Second(Now) < 15 Then

              UpdateEmbededWorkbooks

          ElseIf Minute(Now) = 40 And Second(Now) < 15 Then

              UpdateEmbededWorkbooks

          ElseIf Minute(Now) = 50 And Second(Now) < 15 Then

              UpdateEmbededWorkbooks

          ElseIf Minute(Now) = 0 And Second(Now) < 15 Then

              UpdateEmbededWorkbooks

          End If

          On Error Resume Next

              Dim obj As OLEObject

              Set obj = ThisDisplay.OLEObjects.Item(1)

              obj.Object.ActiveSheet.Calculate

      End Sub