Skip to Content
Author's profile photo Former Member

Cannot get Excel event to fire on Workbook Open

When opening an excel document through the EPM Add-in via the web client, I cannot get the the Workbook_Open() procedure within ThisWorkbook to fire. It works fine (i.e. fires as it should) if I just double click on the excel file and open the file that way. I am trying to get the code below to fire but do not worry so much about what this code is doing but the fact that it does not even fire

Private Sub Workbook_Open()

    Dim EPMObj As New FPMXLClient.EPMAddInAutomation
   
    EPMObj.Logon

    Run (“UnprotectLayout.UnprotectLayout”)

    ‘This code is used to “trip” the parameter values to be set to the sunset colors
    ‘so that a refresh is indicated when the conditional formatting triggers for the
    ‘selection boxes F3, 5 and 7
    Cells(3, 12).Value = Cells(3, 12).Value & “TripTheColor”
    Cells(5, 12).Value = Cells(5, 12).Value & “TripTheColor”
    Cells(7, 12).Value = Cells(7, 12).Value & “TripTheColor”
   
    Run (“ProtectLayout.ProtectLayout”)

   
End Sub

Assigned tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi

      What exactly your problem is? You want your sub to run automatically after opening file?

      Jozef

      Author's profile photo Mark Sapey
      Mark Sapey

      Hi,

      On BPC 10.x this is disabled.

      Instead use AFTER_WORKBOOK_OPEN.

      This has to be in a code module and not in ThisWorkbook.

      Regards,

      Mark