Dirty Laundry
New Member
- Joined
- Jan 17, 2009
- Messages
- 33
Hello - I am looking for assistance with my Autpen macro. Currently it forces the workbook closed after a designated expiration date. I'm trying to alter it so that users have read-only access to the workbook after it expires, rather than forcing it closed. Any suggestions would be greatly appreciated. Thanks! - DL
Code:
Sub Auto_Open()
'
' AutoOpenDGF Macro
'
Dim exdate As Date
exdate = "01/17/2012"
If Date > exdate Then
MsgBox ("-- W A R N I N G --" & vbCr & vbCr & "This workbook expired on 01/17/2012." & vbCr & vbCr & "Please obtain the current version.")
ActiveWorkbook.Close
End If
MsgBox ("-- N O T I C E --" & vbCr & vbCr & "This workbook will expire in (" & exdate - Date & ") days.")
'
End Sub