pass thru password prompt in MS Project 98

A

aditya

I have a macro in Microsoft project.
It does every automation I wanted.
But I am getting this wierd password prompt even after I mentioned in
the code to open a .mpp file as readonly

FileOpen Name:="Sample.mpp",Readonly:=True

even after specifying this file to open readonly, it still prompts me
with password prompt.

any ideas? to get rid of this box.
Also I am not the owner for this .mpp project file.
I just want to extract data from this mpp file into excel which I
already have done.

how to avoid password prompts
 
J

John

aditya said:
I have a macro in Microsoft project.
It does every automation I wanted.
But I am getting this wierd password prompt even after I mentioned in
the code to open a .mpp file as readonly

FileOpen Name:="Sample.mpp",Readonly:=True

even after specifying this file to open readonly, it still prompts me
with password prompt.

any ideas? to get rid of this box.
Also I am not the owner for this .mpp project file.
I just want to extract data from this mpp file into excel which I
already have done.

how to avoid password prompts

aditya,
There are basically three options a file owner can attach to the file.
The lowest level is for read-only recommended. This causes an alert to
pop up but doesn't prevent other users from opening, editing and saving.
The other two options are for password protection. The first requires a
password to even open the file. The second will allow a user to open the
file but as read only and it cannot be saved even under a different name.

You don't mention which password prompt appears but if you still getting
the prompt I would guess the whole file is password protected, which
makes me wonder how you extracted the data you need. (Note: this
information applies to Project 2000 and up. Although I have Project 98,
I currently am unable to access the password tools to see if Project 98
is set up a little differently.)

Generally if there are password prompts, there is no way to work around
them, VBA or otherwise. And when you think about it, isn't that the
purpose of having a password? Your best bet is to see if the file owner
will either, give you the password, have him/her set it up with a write
protection password only, or eliminate the password protection
altogether.

John
Project MVP
 
A

aditya

John~

Thanks for your valuable time and response.
Yes the project file is password write protected and readonly available
for others.
I hit readonly button when it prompts for password rather than typing
and then move on do the steps that I have to for extracting data...
So this file is not complete password protected.
This is password protected for write only but any one can read the data
what is in??

So I am looking to extract data ...
This is the code I have been using....

Sub RealMacro()
' This macro is for automatically exporting data from Project Planning
to Excel sheets for both Design and Construction.
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{ENTER}", True
FileOpen Name:="O:\Det06.mpp", ReadOnly:=True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{ENTER}", True
FileOpen Name:="O:\Neast06.mpp", ReadOnly:=True
'SendKeys "{tab}"
'SendKeys "{tab}"
'SendKeys "{Enter}"
FileOpen Name:="O:\Nwest06.mpp", ReadOnly:=True
'SendKeys "{tab}"
'SendKeys "{tab}"
'SendKeys "{Enter}"
FileOpen Name:="O:\West06.mpp", ReadOnly:=True
'SendKeys "{tab}"
'SendKeys "{tab}"
'SendKeys "{Enter}"
FileOpen Name:="O:\Allreg06.mpp", ReadOnly:=True
Alerts (False)
ViewApply Name:="XYZ OHL DESIGN"
FileSaveAs Name:="O:\OHL Design Data Current.xls",
FormatID:="MSProject.XLS5.8", map:="XYZ OHL Design Data"
ViewApply Name:="XYZ OHL CONSTRUCTION"
FileSaveAs Name:="O:\OHL Construction Data Current.xls",
FormatID:="MSProject.XLS5.8", map:="XYZ OH Construction Data"
Alerts (True)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
FileCloseAll (pjDoNotSave)
' End of Macro
End Sub


I have no idea, what could be the best way to avoid this password
prompt for the readonly projects...

Thanks

Aditya
 
J

John

aditya said:
John~

Thanks for your valuable time and response.
Yes the project file is password write protected and readonly available
for others.
I hit readonly button when it prompts for password rather than typing
and then move on do the steps that I have to for extracting data...
So this file is not complete password protected.
This is password protected for write only but any one can read the data
what is in??

So I am looking to extract data ...
This is the code I have been using....

Sub RealMacro()
' This macro is for automatically exporting data from Project Planning
to Excel sheets for both Design and Construction.
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{ENTER}", True
FileOpen Name:="O:\Det06.mpp", ReadOnly:=True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{Tab}", True
'SendKeys "{ENTER}", True
FileOpen Name:="O:\Neast06.mpp", ReadOnly:=True
'SendKeys "{tab}"
'SendKeys "{tab}"
'SendKeys "{Enter}"
FileOpen Name:="O:\Nwest06.mpp", ReadOnly:=True
'SendKeys "{tab}"
'SendKeys "{tab}"
'SendKeys "{Enter}"
FileOpen Name:="O:\West06.mpp", ReadOnly:=True
'SendKeys "{tab}"
'SendKeys "{tab}"
'SendKeys "{Enter}"
FileOpen Name:="O:\Allreg06.mpp", ReadOnly:=True
Alerts (False)
ViewApply Name:="XYZ OHL DESIGN"
FileSaveAs Name:="O:\OHL Design Data Current.xls",
FormatID:="MSProject.XLS5.8", map:="XYZ OHL Design Data"
ViewApply Name:="XYZ OHL CONSTRUCTION"
FileSaveAs Name:="O:\OHL Construction Data Current.xls",
FormatID:="MSProject.XLS5.8", map:="XYZ OH Construction Data"
Alerts (True)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
'FileClose (pjDoNotSave)
FileCloseAll (pjDoNotSave)
' End of Macro
End Sub


I have no idea, what could be the best way to avoid this password
prompt for the readonly projects...

Thanks

Aditya

Aditya,
Visual Basic for Applications is compatible for Project 98 through
current versions but maybe something has changed in the way VBA
interacts with write protection. I normally use Project 2003 Pro. With
that configuration, if you use the FileOpen Method with ReadOnly set to
"true", the password prompt will NOT appear. The prompt WILL appear
however if full password protection is attached to the file.

Unfortunately there is a problem with my registry for Project 98 so I
can't try out the code myself. I hope to have that resolved in a day or
two. Then maybe I can give you some additional insight. Meanwhile if
someone else has an answer, please step in.

John
Project MVP
 

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