General discussion

  • Creator
  • #2188871

    Excel – execute macro on opening


    by jjoc11762 ·

    I would like to automatically execute a macro whenever a workbook is opened.



All Comments

  • Author
    • #3046412


      by charliespencer ·

      In reply to Excel – execute macro on opening

      Aw c’mon, did you even -try- to use the built-in Help function? What are you a consultant on?

      Click Help.
      In the Search box, enter “macros”.
      In the Search results, click “Run a macro”.
      Now click “Have a macro run automatically…”

      These steps are detailed for Excel 2003. The sequence may be different for other versions; your mileage may vary. Offer void where prohibited.

      • #3045319


        by jjoc11762 ·

        In reply to F1

        Thanks very much.
        I am retired – used to manage the installation of PeopleSoft HR systems etc.

        I am fooling around with VBA


    • #3045057

      On-Open event handler

      by bschaettle ·

      In reply to Excel – execute macro on opening

      You need to code an event handler for the “Open” event of the workbook, which is really easy. Just paste this code into the VBA editor:

      Private Sub Workbook_Open()
      MsgBox “You opened the workbook.”
      End Sub

Viewing 1 reply thread