Consulting

Results 1 to 3 of 3

Thread: Solved: Disable Workbook_Open macro when opening another workbook

  1. #1
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location

    Solved: Disable Workbook_Open macro when opening another workbook

    Hey guys

    Here's the deal.
    I have a procedure that opens another workbook to import data into it. It has a Workbook_Open event that I don't want to execute when it opens, how do I disable it???

    Thanks




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  2. #2
    Knowledge Base Approver
    The King of Overkill! VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    Hi Joseph,

    Application.EnableEvents is your friend here [vba] Dim WB As Workbook
    Application.EnableEvents = False
    Set WB = Workbooks.Open(WBPathAndName)
    Application.EnableEvents = True[/vba]Matt

  3. #3
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Awesome, forgot about that one!

    Thanks Matt




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •