MS Project VBA to Make A Second Project Visible

RobV 1 Reputation point
2021-01-30T19:52:53.703+00:00

I have a macro that resides in .mpp1. It opens and activates .mpp2. The macro then presents a User Form that captures processing parameters. Before the extract begins, I want the user to be able to select tasks from .mpp2.

The problem is that .mpp2 is not visible, even though it's the ActiveProject. Instead, the User Form appears with a blank Project in the background. I can see Timeline and Gantt Chart labels, which are grayed out, but no tasks. (Btw, .mpp2 has Timeline turned off.)

If I run the macro in debug mode with a breakpoint just before the selection is to be made, I'm able to manually activate the .mpp2's window by clicking on its icon at the bottom of the VBA Editor window. I can then highlight tasks.

I've recorded those steps and inserted the code (ActiveProject.Windows. ActiveWindow.Visible) in the macro, but they do not produce the same result--the
details of .mpp2 remain invisible.

In this scenario, how do I make .mpp2 tasks visible for selection?

0 comments No comments
{count} votes