• Disable On Open Event in VBA

    Author
    Topic
    #466503

    Hi,

    I was asked this question from a client…

    They have a workbook that has a VBA userform that opens when the workbook is opened (the On Open event) (Lets name this workbook “Source”)

    In another workbook they are running a macro that needs to access info in the Source workbook. This macro opens Source so it can copy some data in it, but, when Source opens, the userform is loaded as the On Open event fires.

    Question:
    How can I stop the userform from opening automatically when this macro opens Source??? Currently the user has to cancel the userform each time for the macro to continue running?

    TIA

    Viewing 1 reply thread
    Author
    Replies
    • #1208549

      put an
      Application.EnableEvents = False
      before the Workbooks.Open statement.

    • #1208569

      Tx Cecil.

      Its working!

      Cheers

    Viewing 1 reply thread
    Reply To: Disable On Open Event in VBA

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: