Automation application - MS Project gets erractic

H

Hugues Perron

Hi all,

I've written an automation application that is quite simple.

get projectcs list (from PDS. About 200 projects)
open MSProject connecting to Project server
for each project
open the project
calculateAll
save the project
close the project
end for
Close MS Project

This application runs in background and start the update every days at a
specified time, or when the user starts it.

The problem is it runs perfectly for 3 to 4 times, then it becomes
erratic. In fact MS Projetct Get stuck (waiting for a user input when
nnormally it should not) during the save or during the close or generate
an exception (like unexpected error) during the update of some random
projects. When this happen, I have to restart MSProject and retry the
update for the project sometimes it works sometimes not. The worst is
that the more the application runs, the more it happens and on
different projects. After 10 or 11 runs, it fails almost for each
project. I have to reboot the server.

I thought it could have been a memory leak or something like that, but
even if I close and restart the application for each run, the same
problem occurs.

Thanks in advance for any help or suggestions

Hugues
 
C

CQ

First - do you have it where it "automatically publishes on save"? I did a
similar script as you have but got the same results - erratic behaviour after
a few schedules went through. I modifed my setting so that they no longer
automatically published.

Then, I did the open, calculate, save, publish, save, close. Yes, I have
save in there twice. Even though it saved before it published, on some
schedules it would wait for user input to save the schedule again before it
would close. Since I put those commands in this order, I haven't had any
problems.
 
H

Hugues Perron

Hi CQ,

Thanks for your reply. It was a very interesting suggestion. But
unfortunatly, there is no automatic publish on save. Also, the problems
occurs sometimes during the save. But I will try the save publish save
close, just to see how it goes.

Many thanks again

Hugues

CQ a écrit :
 
C

CQ

Hi Hugues,

The automatic publish that I was referring to is in Tools, Options,
Collaborate, where the check boxes are there for "on every save, publish the
following information to Project Server" Those are the checkboxes that we
had to uncheck.
 
H

Hugues Perron

Hi CQ,

That's what I thought. I've looked in the enterprise global to see if
the options were checked, but that was not the case. I could check in
the projects that fail, but as I said, it's random. Probably random in
the projects that have the options checked. The problem is that for now
I cannot check, because I've rebooted the server and it's running well
or now. I have to wait a couple of runs.... (each one takes about two
hours....)

Hugues

CQ a écrit :
 
J

Jeff Baril

I had a similar problem. When I'd save the file it wouldn't actually save it.
I played with settings until I got lucky. I used VBA from MS Acccess
through a link to the project server database:

Public Function ExportProjects()

Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim sql, filename As String
Dim objPrj As Object

Set objPrj = CreateObject(Class:="MSProject.Application") 'Create an instance

sql = "select PROJ_NAME from PROJECT_MSP_PROJECTS WHERE PROJ_EXT_EDITED = 1"
rs.Open sql, CurrentProject.Connection, adOpenDynamic, adLockOptimistic

With rs
While Not .EOF

PrjFileName = "<DBID>\" + .Fields(0).Value
NewPrjFileName = "<PATH>\" + .Fields(0).Value

Call objPrj.Alerts(False)
objPrj.DisplayAlerts = False
objPrj.FileOpen Name:=PrjFileName, ReadOnly:=False, UserID:="<USERID>",
DatabasePassWord:="<PASSWORD>", noAuto:=True, openPool:=4
Call objPrj.FileSave
Call objPrj.FileSaveas(NewPrjFileName)
Call objPrj.FileClose
.MoveNext
Wend
End With

End Function

Don't know if that helps...
 
H

Hugues Perron

Hi Jeff,

Thanks for the answer.

It's an interesting suggestion. I'll take a look !

Hugues

Jeff Baril a écrit :
 

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