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
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