Close Project1 on open

B

Brian Lukanic

Is there a way to have VBA close the default "project1" when the app opens?
Such as an onopen event? Can I add this macro to my global file? My Server
users are fed up with having to close/not save/not check in that default
Project1 file every time they close Project. I'd like it to disappear
immediately upon opening, or even automatically close Project1 on app close
and suppress error messages.

I am aware that you can set Project to "open last file on startup" but that
can be equally annoying.
 
J

Jack Dahlgren MVP

If vba is enabled you can probably do it, but it would have some side
effects. What if users want to create a new project?

-Jack Dahlgren
 
J

Jan De Messemaeker

Hi,

Can't check it in Server here, but in Professional the following, when
installed in your Global's ThisProject, does exactly what you want:

Private Sub Project_Open(ByVal pj As Project)
If Projects.Count = 1 Then
FileClose pjDoNotSave
End If
End Sub

Greetings,
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availabliy check:
http://users.online.be/prom-ade/Calendar.pdf
 
R

Rod Gill

I would add a test for pj.name="Project1" otherwise I think this code would
close every project?

Private Sub Project_Open(ByVal pj As Project)
If Pj.name="Project1" Then
FileClose pjDoNotSave
End If
End Sub


--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top