rsen1
asked on
VBA to set Excel macro security
Guys, how do I put a code that the security setting will not open my workbook past a given date. I have the code below, but the macro security option still allows the workbook to open if security is set to disable macros. And simply clicking cancel allows the workbook to function.
Private Sub Workbook_Open()
Dim Expire As Date
'Workbook expires on this data and file will be shut down
Expire = "15-Feb-2012"
ActiveWorkbook.Close
End Sub
Thank you for your help
Private Sub Workbook_Open()
Dim Expire As Date
'Workbook expires on this data and file will be shut down
Expire = "15-Feb-2012"
ActiveWorkbook.Close
End Sub
Thank you for your help
ASKER
thank you for your response, is there a way to set the security such as Application.FixedDecimal = True,
except state "application.security= enable''
or something like that
except state "application.security= enable''
or something like that
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Guys
Hide all other "normal" worksheets, and save it in that state.
Then have your code unhide the sheets (with the Open event) if the expiration date is not reached.
Note: you'll also want to hide them again with the BeforeSave event to prevent a user from saving them in the un-hidden state.
McOz