Closing Project

R

roccogrand

This is has got to be the dumbest question ever.

How do I close Project without a single click?

I am using Access to create Project files and most times I don't want to the
save the .mpp file. Through Access Automation, an .mpp file is created and
Project refuses to close without saving the file so I have a Project1.mpp
file that write over and over and over. All I want to do is shut the darn
thing down.

Is there a better way?

LDN
 
J

Jan De Messemaeker

Hi,

I don't know what exactly is meant by Access Automation.
If this si something using the MS project objects (VBA...) then you do
(supposing MSPapp ids the MS Project application object)
MSPapp.FileClose pjdonotsave
MSPapp.quit
set MSPapp=nothing
Hope this helps,
 
R

roccogrand

Thanks Jan.

After changing the Object name, your solution worked perfectly as:

Private Sub cmdQuitProject_Click()
On Error GoTo Err_cmdQuitProject_Click

appProject.FileClose pjDoNotSave
appProject.Quit
Set appProject = Nothing

Exit_cmdQuitProject_Click:
Exit Sub

Err_cmdQuitProject_Click:
MsgBox Err.Description
Resume Exit_cmdQuitProject_Click

End Sub

By "Access Automation" I meant that I use MS Access to copy the project plan
into Project. The code above is attached to a command button on an Access
form.

And sorry about the extra words in the message, I didn't have my computer
glasses on last night and I am almost blind without them.

Have a good one.
LDN
 

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