How to Run a Microsoft Project Macro Automatically After Schedule Changes
Question details
The user needs to automatically execute a VBA macro whenever schedule data is modified in Microsoft Project without causing performance issues.

- Product
- Microsoft Project
- Device & OS
- not provided
- Scenario
- Automating task formatting or schedule calculations via a VBA macro triggered by schedule updates.
- Observed behavior
- The user wants to automate execution but needs to mitigate the performance drop caused by the Project Change event firing on every single edit.
Ensure that your Microsoft Project file is saved as a Macro-Enabled Project (.mpp) and that your Trust Center settings allow VBA macros to execute.
Use the Project Change Event with Conditional Limits
Utilize the Project_Change event to trigger the macro automatically, but add conditional logic to limit execution to specific task-level changes.
The Project_Change event fires every time any data in the schedule is modified. To prevent Microsoft Project from slowing down, you should restrict the execution of your formatting or calculation macros to specific conditions rather than running the full code on every edit.
Press Alt + F11 in Microsoft Project to launch the Visual Basic for Applications (VBA) editor window.
In the Project Explorer pane on the left side, double-click on 'ThisProject' to open the dedicated code window for your current project file.
Select 'Project' from the left dropdown menu at the top of the code window, and then select 'Change' from the right dropdown menu to generate the event subroutine.
Inside the subroutine, add an 'If' statement to check if the changed fields belong to the specific activity or summary-task levels you are targeting before calling your main macro. This filters out unnecessary executions.

Trigger Macros on Open or BeforeClose Events
Run your formatting or update macros only when opening or closing the project file to maintain optimal performance during active editing.
Manage Project Schedules Effortlessly with WPS Office
Complex VBA macros in Microsoft Project can sometimes slow down your workflow. If you are looking for a highly compatible, free alternative to manage project timelines, Gantt charts, and schedules, WPS Spreadsheet offers an excellent, lightweight solution. It fully supports Microsoft Excel formats and provides robust macro features without the high subscription costs.
- 1. Download and Install WPS Office: Visit the official WPS Office website to download the free suite and install it on your computer.
- 2. Open a Project Tracker Template: Launch WPS Spreadsheet and browse the built-in template library for 'Gantt Chart' or 'Project Schedule' to start tracking your tasks.
- 3. Enable Macros for Automation: If you are migrating existing Excel project trackers with VBA, go to the Developer tab to seamlessly manage and run your macros.

Frequently Asked Questions
Why does the Project Change event slow down Microsoft Project?
The Project Change event is triggered every single time any value is modified in the schedule. If a macro runs complex calculations or heavy formatting on every keystroke or update, it heavily consumes system resources, resulting in noticeable application lag.
Can I run a macro only when a specific column is changed in MS Project?
Unlike Excel, VBA in Microsoft Project does not have a built-in event specifically for a single cell or column change. You must use the Project Change event and write custom VBA logic to evaluate changes and determine if your target data was affected.
How do I temporarily stop my macro from firing during bulk updates?
You can temporarily disable events in your VBA code by setting 'Application.EnableEvents = False' before running a bulk update or pasting large amounts of data, and then setting it back to 'True' once the operations are complete.




