Open only ReadWrite projects

M

med111

I want to use VBA to open a project (myProj) then make some updates,
save and publish
here is the code :

On Error GoTo skip
Application.FileOpenEx "<>\myProj", False, , , , , True, , , , ,
pjDoNotOpenPool, , , True
ActiveProject.Tasks("tp").Finish = DateValue("12/23/2007")
ActiveProject.Tasks("tp").Notes = "this is a test"
Application.FileSave
Application.Publish True
Application.FileCloseEx pjDoNotSave, True, True
skip:

how can I know if the project can be open with ReadWrite mode before
open it.
the problem is with readonly projects : if the project is checkout by
another user/session, i don't want to open it. I want to do sth like
this :
if not isCheckout("myProj") then
On Error GoTo skip
Application.FileOpenEx "<>\myProj", False, , , , , True, , , , ,
pjDoNotOpenPool, , , True
ActiveProject.Tasks("tp").Finish = DateValue("12/23/2007")
ActiveProject.Tasks("tp").Notes = "this is a test"
Application.FileSave
Application.Publish True
Application.FileCloseEx pjDoNotSave, True, True
end if
skip:
How can I implement isCheckout ?
thanks
 
R

Ran @Comverse

Hi,

The easiest way which I can think of right now is to check directly in the DB.
But which MSP version is it?

Ran.
 
M

med111

Hi,

The easiest way which I can think of right now is to check directly in the DB.
But which MSP version is it?

Ran.







- Show quoted text -

I work with microsoft project 2007 12.0.4518.1014,
So, is it possible ? and how?
thanks
 
R

Ran @Comverse

Do this select:

SELECT PROJ_CHECKOUTBY
FROM MSP_PROJECTS
WHERE (PROJ_UID = @GUID)

if PROJ_CHECKOUTBY is null then the project isn't checked out, else
you will get the resource GUID of the person which checked this project out.
 

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