How to bypass error messages

R

Ronald Dodge

I am running this code within Excel 2002.
This code worked fine when I was using Project 98, but just upgraded to
Project 2000.
Code does reference to the proper Project DLL file.

MSProj.DisplayAlerts = False
Application.DisplayAlerts = False
Application.StatusBar = "Opening " & PF
MSProj.FileOpen Name:=ThisWorkbook.Path & "\" & PF,
OpenPool:=pjPoolAndSharers


The error message coming up is stating that it can't locate inserted project
files (1 at a time of course). How can I get the program to skip the file
and bypass this error message? Need to have this code not only during the
day, but also overnight as this code is ran twice daily, and since I'm not
here for the night side of it's running, I won't be here to baby sit it of
which I don't like baby sitting code anyhow.

TIA

Ronald Dodge
Production Statistician
Master MOUS 2000
 
J

JackD

Display Alerts = False
Should do it.
However you might also try

OptionsView CrossProjectLinksInfo:=False

You might try to set this option manually in the project if doing it in code
doesn't work.

You do it manually by going to Tools menu /options / view tab.
 
J

Jan De Messemaeker

Hi,

Hoping that you reply the message with "Enter" insert the following before
the Open instruction:

Sendkeys "~~~~~~~~~~~~~~~"

HTH
 
J

John

Ronald Dodge said:
I am running this code within Excel 2002.
This code worked fine when I was using Project 98, but just upgraded to
Project 2000.
Code does reference to the proper Project DLL file.

MSProj.DisplayAlerts = False
Application.DisplayAlerts = False
Application.StatusBar = "Opening " & PF
MSProj.FileOpen Name:=ThisWorkbook.Path & "\" & PF,
OpenPool:=pjPoolAndSharers


The error message coming up is stating that it can't locate inserted project
files (1 at a time of course). How can I get the program to skip the file
and bypass this error message? Need to have this code not only during the
day, but also overnight as this code is ran twice daily, and since I'm not
here for the night side of it's running, I won't be here to baby sit it of
which I don't like baby sitting code anyhow.

TIA

Ronald Dodge
Production Statistician
Master MOUS 2000

Ronald,
The code I use to "jump around" an error such as might be generated for
a "file not found" type of scenario is the following:

'set up controlled error detection and handling
On Error Resume Next
TempStr = ActiveProject.Name
If Err > 0 Then
'tell the user what the error was and give them a suggested solution
MsgBox "There is no open project." & Chr(13) & _
"Please open a project and run again.", vbCritical
'clear the active error
On Error GoTo 0
End
End If

Hope this helps.
John
Project MVP
 
R

Ronald Dodge

This isn't dealing with the main project file (the file that does all of the
calculations and charting based on the data in all of the open individual
project files) that's not opening as I have a completely different error
handle for that issue, but rather the individual files that contains data
for each of the individual projects we have are the ones not being located,
thus not being opened into the main summarized project file

Well none of the following caught it:

MSProj.Alerts = False
MSProj.DisplayAlerts = False
The "On Error" statement wasn't triggered either, else it would have errored
out in a different manner for how I have the code setup.

The only thing left for me to do is to set each of the mini schedules'
property per what Jack has mentioned in this thread, which I will have to
deal with that this evening after everyone else has left for the day.
 
R

Ronald Dodge

After doing further debugging on the code, I have come to realize it's at
the time when the code attempts to "Show All Tasks" and at least one of the
dependent project files didn't open due to incorrect pathname, that's when I
get the dialog box, and again, none of the 3 error skippings prevents the
dialog box from popping up. However, this will involve additional training
for our customer service people, which actually shouldn't be much more
training involved given the issue shows up pretty quickly after the file is
openned, and they just have to go through the relinking process for each
occurrence.

I still like to see if we can find a way to get around this issue.
 
R

Ronald Dodge

In order for it to semi-work, I had to uncheck all 3 boxes within that part
of the View tabbed page in the Options dialog box. 2 problems with doing
this though:

1) Some users are still on MS Project 98 within the company, which means we
can't save the file as MS Project 2000

and

2) Even with all 3 of these boxes UNCHECKED, when I use the code below to
see if there anything there or not, it still brings up the inserted project
not found dialog box. This would still be a problem, even if there wasn't
the version difference.

If ActiveProject.Subprojects(I).SourceProject is Nothing Then 'If this is
true, that's when the dialog box appears and halts the code, and none of the
error trapping stuff gets triggered by this or prevents the dialog box from
appearing.

So how can I tell if a subproject is open or not without bringing up such
dialog box and not be forced to have it saved as MS Project 2000?
 

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