Phoenix Using VBA Macros on MS Project Spencer
Phoenix Using VBA Macros on MS Project Spencer Lamoreaux Chapter Monthly Meeting March 9 th, 2010
Why use VBA? • Create custom toolbars • Generate special reports • Perform Custom Functions/Automate Routine Tasks
Enhanced Toolbars Link to IT MSPS Help Quick look at tasks in the next 2 weeks Baseline Project Shortcut Quick menu to custom Filters Quick menu to custom views Filter on dependent tasks for any selected task View Gantt by ww, Qtr, Month, or Days Reset all filters & groups Quick menu to custom Groups Highlight Filters Show Progress Lines Assign team resources Update team vacations Process Web Updates Publish Project to Reports
Basic Process to Create Macro 1. Open project and go to the Visual Basic View (Alt. F 11) 2. Click INSERT – MODULE (1 st time only. The module will hold all your future macros. ) 3. Add the code. Use the object browser if needed to find out functions/objects 4. Customize the ribbon/toolbar to add the new macro to a button. 5. Test and implement!
Basic Example: Hyperlink Sub Jump. To. MPUG() Follow. Hyperlink ("http: //mpug. com") Command. Bars("Web"). Visible = False End Sub
Reset the Filters Sub Reset. All. Filters() Filter. Apply Name: ="All Tasks" Group. Apply Name: ="No Group" Outline. Show. All. Tasks End Sub
Custom View Macro Sub My. Custom. Gantt() Pane. Close View. Apply Name: ="0 b - Build Gantt Split" Window. Activate Top. Pane: =False View. Show. Resources. Predecessors End Sub
Resource Allocation Macro Sub Resource. Allocation. With. Graph() View. Apply Name: ="2 c - Resource Allocation with Graph" Select. Sheet Outline. Hide. Sub. Tasks Sort Key 1: ="Start", Renumber: =False Select. Resource. Field row: =0, Column: ="Name" Goto. Task. Dates End Sub
Deploying the Code • Project Server – Simple: Add the code module and views/macro buttons to the enterprise global. • MS Project Client Only: – Save a new global. mpt and distribute to your peers with intructions to replace their own global Careful! This will remove any of their own customizations (uncommon).
Free Code!!! • Go to www. agisusa. com – Go to Recordings and add the “VBA Macros and Toolbars” to your cart. – Use “MPUG” at checkout to download it and a video for its usage for free.
- Slides: 10