Worksheet security

  • Thread starter Thread starter Peter B
  • Start date Start date
P

Peter B

Is there a way to secure a worksheet, after a set number
of hours, so that no more entries can be made in the
cells?

Thank you
 
Peter B,

I take it that your previous post from anonymous didn't get answered
and that you're the same person????

Anyway...to answer your question(s)...
Is there a way to secure a worksheet
Yes and no.......
Depends on who you're trying to "secure" it from???
Somebody that doesn't know Excel at all?? Probably
Somebody with experience in Excel (or access to this ng or Google)??
Not a chance.....

Okay...enough of the disclaimers......

In a regular module (Alt+ F11, right click on "ThisWorkbook,
select "Insert" and then "Module").
Copy and paste the following:

Sub Auto_Open()
Application.OnTime Now + TimeValue("00:01:00"), "StopMe"
End Sub

Sub StopMe()
ThisWorkbook.Save
ThisWorkbook.ChangeFileAccess xlReadOnly
End Sub

The above will start a 1 hour timer when the workbook opens.
After an hour, it will call the StopMe sub.
That sub will save the workbook (optional) and change the
file access to ReadOnly

John
 
Back
Top