Audit timeline updates


I

Inquisit1

Hello,

Throughout our initial planning process we have several PMs, internal and
external, that will be opening and potentially modifying the timeline prior
to the actual kick-off day (before the timeline is published).

I plan on having them access the timeline through the Project Server, and
that will ensure only one update is made at a time via the check-in /
check-out process. The catch is that we want to be able to audit all the
updates and changes made to the timeline so if at any point a PM wants to go
back to a previous revision they can.

I am not aware of any built-in way to do this similar to tracking changes in
MS Word, so I've been looking into using a macro that will create local
copies of the timeline anytime a project is checked-out, and will delete it
if no changes are made to the timeline; effectively keeping a local copy of
all 'versions' of the timeline.

My problem with this approach has been on the "FileSaveAs" method. Once the
file is saved as a local copy the server copy is checked back in and the
local file becomes the active project. Not a big deal, I can just close the
local copy and check-out the server copy again.... right? Well, not so
fast.... If the macro tries to check-out the server copy before it has
checked it in on the "FileSaveAs" method it will only open in "ReadOnly"
mode....

So, my question is....How can I check to see that the file is checked-in
before trying to check it back out again?....or prevent it from being
checked-in in the first place?

Thanks for any help!

--Inquisit1
 
Ad

Advertisements

R

Rod Gill

Hi,

I searched to Object Browser and found the Projects.CanCheckOut Method. Give
that a try.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

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




Inquisit1 said:
Hello,

Throughout our initial planning process we have several PMs, internal and
external, that will be opening and potentially modifying the timeline
prior
to the actual kick-off day (before the timeline is published).

I plan on having them access the timeline through the Project Server, and
that will ensure only one update is made at a time via the check-in /
check-out process. The catch is that we want to be able to audit all the
updates and changes made to the timeline so if at any point a PM wants to
go
back to a previous revision they can.

I am not aware of any built-in way to do this similar to tracking changes
in
MS Word, so I've been looking into using a macro that will create local
copies of the timeline anytime a project is checked-out, and will delete
it
if no changes are made to the timeline; effectively keeping a local copy
of
all 'versions' of the timeline.

My problem with this approach has been on the "FileSaveAs" method. Once
the
file is saved as a local copy the server copy is checked back in and the
local file becomes the active project. Not a big deal, I can just close
the
local copy and check-out the server copy again.... right? Well, not so
fast.... If the macro tries to check-out the server copy before it has
checked it in on the "FileSaveAs" method it will only open in "ReadOnly"
mode....

So, my question is....How can I check to see that the file is checked-in
before trying to check it back out again?....or prevent it from being
checked-in in the first place?

Thanks for any help!

--Inquisit1

__________ Information from ESET Smart Security, version of virus
signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
I

Inquisit1

Rod,

Thanks for your reply, and yes I've tried this method; however I can only
get it to return 'false' regardless of whether the project is checked-in or
out. It is my understanding that the "Projects" object only holds the names
of projects currently loaded into MS Project 2007. I found a post that
suggested opening the project as "ReadOnly", then checking the "CanCheckOut"
mothod, but that also only returns false.

At this point, I'm a little dumb-founded how that method doesn't seem to do
what it 'appears' it should do, so at this point the only way I have found to
programmatically determine if a project is checked out is to use the Project
Server Event-handler 'onCheckin' method to create a temp file on the server
that I can have the macro check for before it attempts to open the file.
 
R

Rod Gill

Another way is to open the project, test if it's read only. If it is, close
it again then re-open it. Repeat until it opens read/write.

There's a readonly flag on the project object.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

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




Inquisit1 said:
Rod,

Thanks for your reply, and yes I've tried this method; however I can only
get it to return 'false' regardless of whether the project is checked-in
or
out. It is my understanding that the "Projects" object only holds the
names
of projects currently loaded into MS Project 2007. I found a post that
suggested opening the project as "ReadOnly", then checking the
"CanCheckOut"
mothod, but that also only returns false.

At this point, I'm a little dumb-founded how that method doesn't seem to
do
what it 'appears' it should do, so at this point the only way I have found
to
programmatically determine if a project is checked out is to use the
Project
Server Event-handler 'onCheckin' method to create a temp file on the
server
that I can have the macro check for before it attempts to open the file.



__________ Information from ESET Smart Security, version of virus
signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
I

Inquisit1

Rod,

I am trying your suggestion, but if it can't be opened in read/write mode
then it prompts the user to open in readonly. How to I automate the
selection in that dialog?

--Inquisit1
 
I

Inquisit1

Also, what's the best way to check if the project was modified while it was
opened? I've tried calling the "Undo" method and then checking the
errorlevel = 0 to tell if project has any Undo's, but I found that if the
project is ever saved during modification the undo's are wiped out.

Thanks for any help!
 
Ad

Advertisements

R

Rod Gill

Hi,

Try:
Application.Displayalerts=false before opening then
Application.Displayalerts=True afterwards

The only way to test is to look at the lastsavedate property.
--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

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




Inquisit1 said:
Also, what's the best way to check if the project was modified while it
was
opened? I've tried calling the "Undo" method and then checking the
errorlevel = 0 to tell if project has any Undo's, but I found that if the
project is ever saved during modification the undo's are wiped out.

Thanks for any help!

__________ Information from ESET Smart Security, version of virus
signature database 5106 (20100511) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 5106 (20100511) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
Ad

Advertisements

I

Inquisit1

Rod,

That solution is working! Best of all, I can avoid using the server-side
events.. Thanks a lot!
 

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