Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Dec 2002
    Location
    San Francisco, California, USA
    Posts
    54
    Thanks
    6
    Thanked 1 Time in 1 Post

    Run Macro When User Opens WorkBook or Presentation (VBA Excel and PowerPoi

    I want to run a macro when I open an existing Workbook in Excel or Presentation in PowerPoint. Further, anytime I save either, I want to run the same macro. The macro will insert or update a document management system (DMS) id.

    I have the DMS string, I just want it to automatically update.

    Any suggestions?

    Thanks,
    Larry

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Run Macro When User Opens WorkBook or Presentation (VBA Excel and Powe

    Larry,

    You should be able to use a similar approach to do this in both Excel and PowerPoint - in both cases, you will need to have a global add-in template (.xla in Excel, .ppa in PowerPoint) that runs when the application starts up, and you will need to use application-level event procedures to respond to events like the opening and saving of workbooks and presentations.

    No doubt both of these techniques have been covered in detail here before, but with the Search facility out of commission, they may be hard to find.

    You can find introductory material on both techniques in MS Press' Microsoft Office 2000 Visual Basic Programmer's Guide - this book is out of print but fortunately it is available online at the MSDN site:

    Creating an Excel add-in
    Creating a PowerPoint add-in
    Creating application-level event procedures

    Gary

  3. #3
    Star Lounger
    Join Date
    Dec 2002
    Location
    San Francisco, California, USA
    Posts
    54
    Thanks
    6
    Thanked 1 Time in 1 Post

    Re: Run Macro When User Opens WorkBook or Presentation (VBA Excel and Powe

    Gary,

    Thanks for your help. Yes, your references were very useful. Also, John Walkenbach's book Microsoft Excel 2000, Power Programming with VBA, p. 540 covers this topic really well. Since I'm new with Office XP (2002), I wanted to make sure that this topic was handled the same way.

    Thank you for your response.

    Larry

Posting Permissions

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