Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copied file does not copy as Read Only?

Status
Not open for further replies.

advox1

Technical User
Nov 28, 2003
26
0
0
GB
Hi,

I have some code which creates a new folder and copies a workbook into it. The original copy of the workbook is Read Only, defined by the properties and not passwords.

The problem is that when I copy the workbook to the folder it looses the Read Only protection. How can I ensure that this does not happen or change the file back to read only once it has copied?

Thanks

Jo
 
When you *SaveAs* a file you can set the property ReadOnlyRecommended = True. *The user then gets the option* to open the file as read only or not.

If you do not want to allow changes to the file you can intercept and disable the Save in the ThisWorkbook Before_Save event, (Cancel = True) and likewise the Before_Close event (... Close .... SaveChanges=False)




Regards
BrianB
Use CupOfCoffee to speed up all windows applications
================================
 
Hi

Thanks for your help but I have decided to protect the sheets and unprotect them when required.

Jo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top