Link to home
Start Free TrialLog in
Avatar of dgmoore1
dgmoore1Flag for United States of America

asked on

MSProject 03: mpp opened by VBA automation in Access opens read-only

I have a Project mpp in a folder on a local drive. For years this file (which gets replaced frequently by a new file with the same name) has opened normally using vba/automation in MSAccess. The file has now begun to open read-only when opened in this manner:
...
Set objMSProj = CreateObject("MSProject.Application")
objMSProj.FileOpen ("c:\MyFolder\CurrProj.mpp")
...
The file is not marked read-only in Windows properties. The issue is that my process includes a save operation, and now a Save As prompt is appearing, which is a problem because the process runs unattended in the middle of the night.

Any suggestions would be appreciated.
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

was there any updates done recently in the computer.
i had a similar case where applications running automatically stops, giving errors etc.,
we traced the problem from upgraded virus protection program..
I do not know the reason why

But as a workaround if u try to force the open specifying readonly flag, does that work?

Set objMSProj = CreateObject("MSProject.Application")
objMSProj.FileOpen ("c:\MyFolder\CurrProj.mpp", ReadOnly:=False)

Also try on the save, use SaveAs

objMSProj.SaveAs "C:\MyFolder\CurrProj.mpp"


These do not solve the reason for readonly open but am hoping it would be something to get you going in the interim
Avatar of dgmoore1

ASKER

I'll try the ReadOnly:=False and see what I get. Thanks
It doesn't like the syntax ("c:\MyFolder\CurrProj.mpp", ReadOnly:=False) (or any version with or without a comma, or putting the ReadOnly inside the quotes, etc.)

Is there a different way of specifying ReadOnly?
Capricorn, as far as I know there have been no computer upgrades, but it's hard to know because I'm on a WAN with thousands of users and admin pushes out upgrades in the middle of the night and we never know about them...
Ok, I do not have project installed but was hoping it would work along the same lines as the other office products.
So having a look I came across this. It seems after a while the file becomes readonly.

http://www.eggheadcafe.com/software/aspnet/33016704/ms-project-sets-open-file-to-readonly-must-do-save-as.aspx

You might need to try the SaveAs as I said earlier. It is also something someone did in the link above.

From the link the responsse from MS is

"I did a bit more looking into the issue. It seems that you are not the first person to have come across this. It is recommended for Project to not open projects through links or file shares. As for why this does not work the same
as other Office products, apparently Microsoft Project was designed outside the Microsoft Office group. Thus many of the basic protocols, such as saving, loading and printing, are fundamentally different from other Office products
from a design standpoint. We can continue testing to verify that it is an issue with opening the project from a file share, but I have been advised that it is very likely that this is what we will find to be the case."

ASKER CERTIFIED SOLUTION
Avatar of dgmoore1
dgmoore1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial