Save as Read only

J

JohnUK

Hi, I need a piece of code that can save a file over a read only file and
save as a read only, but not have a message that gives you a choice of
opening as a read only or not (If that makes any sense)
I have tried this, but doesn’t work:
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="E:\Desktop\Test.xls", _
FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=True
ActiveWindow.Close

Help greatly appreciated
 
J

John Bundy

Try:
Activeworkbook.Saved = True
Activeworkbook.ChangeFileAccess Mode:=xlReadOnly
 
J

JohnUK

Thanks John for your help.
What I should have mentioned is that I have a file that opens from a
different location, and then I want it to save overwriting a read only file,
as a read only file.
How about - opening a read only file, make any changes, then overwriting
itself as a read only, but keeping the name as the original (Not as “copy
ofâ€)?
Ha - hope that makes sense
 

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