Solved

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

Posted on 2010-09-17
7
511 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:dgmoore1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 33703874
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..
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33703994
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
0
 

Author Comment

by:dgmoore1
ID: 33704137
I'll try the ReadOnly:=False and see what I get. Thanks
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:dgmoore1
ID: 33704185
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?
0
 

Author Comment

by:dgmoore1
ID: 33704250
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...
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 33704281
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."

0
 

Accepted Solution

by:
dgmoore1 earned 0 total points
ID: 33727467
I have worked around the problem by saving the original mpp to a new file. The new file is not read-only.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question