Is it possible to write a macro to make a certain file not open 30 days after it is first openned.
i.e. Does not require a password for the first 30 days but needs a password after 30 days of use.
I would appreciate any help on this
Is it possible to write a macro to make a certain file not open 30 days after it is first openned.
i.e. Does not require a password for the first 30 days but needs a password after 30 days of use.
I would appreciate any help on this
There are quite a few ways of doing this, but most people that can put a time lock on their work are reluctant to publish details because it would render their methods useless.
Hi Rennie
Here is one very simple method, that is far from secure, but enough for most cases.
Private Sub Workbook_Open()
'Range "DateCheck" is a named cell on XlVeryHiden Sheet.
If Range("TimeCheck") <> vbNullString Then 'Date has been set.
'Check date.
If Range("TimeCheck") < Date - 30 Then 'Expired
'Your passord Code HERE
End If
Else 'Set first open date
Range("TimeCheck") = Date
Me.Save
End If
End Sub
Display More
Thank you very much Dave and RoyUK, I appreciate your help.:lol::lol::lol:
Don’t have an account yet? Register yourself now and be a part of our community!