ActiveWorkbook.SaveCopyAs with conditions

lukeois

New member
Joined
Jun 25, 2017
Messages
6
Reaction score
0
Points
0
Hi all,

I have a workbook that anyone can view as read-only but requires a password to modify. Currently, I have the following happen when the workbook is closed;

Code:
ActiveWorkbook.SaveCopyAs FileName:="*********Rotamaster.xls"

This works just fine and saves a copy. What I am looking to do is only get the workbook to create a copy if the Modify password is entered i.e. the administrator has opened the sheet and not just every one viewing.

Thanks in advance
 
You could try (untested):
Code:
If Not ActiveWorkbook.ReadOnly Then ActiveWorkbook.SaveCopyAs Filename:="*********Rotamaster.xls"
 
Back
Top