none
Auto_Open subroutine doesn't fire RRS feed

  • Question

  • hello,

    Any ideas on why when users open a template in Excel 2010 through a custom designed menu, the auto_open macro doesn't run?

    I've checked:

    - macro security (OK)

    - any instruction such as "EnableEvents" set to false in the menu making VBA code

    Help everyone ?

    thanks

    fcrysss


    fcrysss


    • Edited by fcrysss Tuesday, November 13, 2012 7:11 AM
    Tuesday, November 13, 2012 7:11 AM

Answers

  • The "old" auto_open routine should run even if EnableEvents is disabled, unlike Workbook_Open. However with automation you need to explicitly call any auto run routines, eg

    Set wb = Workbooks.Open(myFile)
    wb.RunAutoMacros xlAutoOpen

    For your template you will probably want to do Add rather than Open

    Peter Thornton

    • Proposed as answer by VBAToolsMVP, Editor Tuesday, November 13, 2012 10:03 AM
    • Marked as answer by fcrysss Tuesday, November 13, 2012 9:53 PM
    Tuesday, November 13, 2012 8:01 AM
    Moderator

All replies

  • The "old" auto_open routine should run even if EnableEvents is disabled, unlike Workbook_Open. However with automation you need to explicitly call any auto run routines, eg

    Set wb = Workbooks.Open(myFile)
    wb.RunAutoMacros xlAutoOpen

    For your template you will probably want to do Add rather than Open

    Peter Thornton

    • Proposed as answer by VBAToolsMVP, Editor Tuesday, November 13, 2012 10:03 AM
    • Marked as answer by fcrysss Tuesday, November 13, 2012 9:53 PM
    Tuesday, November 13, 2012 8:01 AM
    Moderator
  • Peter,

    That was just spot on. All fixed now. Thank you ever so much!!


    fcrysss

    Tuesday, November 13, 2012 9:52 PM