Results 1 to 3 of 3

Thread: How to ignore auto_open() when Workbooks.Open
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Feb 2011
    Posts
    155
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How to ignore auto_open() when Workbooks.Open

    Hi,

    When I open another workbook in VBA through Workbooks.Open, how to let the program NOT run the auto_open() in that workbook?

    Thanks.

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to ignore auto_open() when Workbooks.Open

    Actually, the Auto_Open doesn't run automatically when you open a workbook through VBA. Only the Workbook_Open() event fires.

    If that's what you are using, then put

    Application.EnableEvents = False

    before opening the file, and restore it to True afterwards.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Feb 2011
    Posts
    155
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to ignore auto_open() when Workbooks.Open

    Thanks Juan.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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