Cheers all!
I got two little problems and i kindly request your assistance.
1. Password protect all sheets without getting any prompts when the user clicks on buttons
In the code window for This Workbook (Workbook_Open event), i protect all sheets using the UserInterfaceOnly argument of the Protect method:
Private Sub Workbook_Open
For each ws in ActiveWorkbook.Worksheets
ws.protect ,,,,UserInterfaceOnly:=True
Next
End sub
The problem:
Suppose i want to enter a password for all sheets in the previous loop.
If i do that, when i click on a Button to activate some procedures i am asked for the password (note: the specific control, i.e. button, is not locked).
Is there any way around this (i.e. password-protect the sheets, but not get the password prompt when the user clicks on unlocked buttons)?
2. Control deletion of Excel file in the same folder
I wish to check a specific folder (Path: ThisWorkbook.Path) for the existence of a specific Excel file with a known file name
(File name to check for = a known string, say "Test").
If the file exists in the folder, i want to delete it.
If not, no action should be taken.
How do i do that?
Your help is very much appreciated.
Thank you for your time,
Alex
Bookmarks