troubleshooting Question

VBA to set Excel macro security

Avatar of rsen1
rsen1 asked on
Microsoft Excel
6 Comments3 Solutions621 ViewsLast Modified:
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 3 Answers and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros