GregLamberson
Petroleum
- Dec 2, 2006
- 577
All:
I previously posted a request for some input on putting expiration dates on spreadsheets and got some great input that allowed me to get that set up.
A couple of follow up questions:
1) I have the code password protected in VBA, but is there a way to prevent users from simply clicking the disable macros tab on start up?
2) As a follow up to 1) above, a former poster had made the following recomendation - "I would put conditional formating that will make the cells all black if the NOW() function is pass certain date. And maybe put a red statement saying it expires. Make sure you put a password so people cant edit it". The question is how would I add conditional formatting? (at the risk of stating the obvious - I'm not an Excel or VBA expert)
The code I am using is (also from a helpful previous poster):
Aut
pen()
ActiveWorkbook.PrecisionAsDisplayed = False
If Date < #3/26/2009# Then Exit Sub
Bye_Message
With ThisWorkbook
.Saved = True
.ChangeFileAccess xlReadOnly
‘ Kill .FullName
.Close False
End With
End Sub
Bye_Message()
'Self-Destruct Final Message no response needed, just OK
ln1 = "This spreadsheet has a defined expiration date which has expired. After the expiration"
ln2 = "date the spreadsheet will not function. Your data will not be lost. Send the file to the"
ln3 = "author to request an updated copy."
In4= “ “
ln5 = "Author is Greg Test (test@yahoo.com / msg = ln1 & vbCr & ln2 & vbCr & ln3 & vbCr & ln4 & vbCr & ln5
style = vbOKOnly + vbInformation
Title = "International Test Consulting, LLC© December 2008, by Greg"
MsgBox msg, style, Title
End Sub
Any help would be appreciated.
Greg Lamberson, BS, MBA
Consultant - Upstream Energy
Website:
I previously posted a request for some input on putting expiration dates on spreadsheets and got some great input that allowed me to get that set up.
A couple of follow up questions:
1) I have the code password protected in VBA, but is there a way to prevent users from simply clicking the disable macros tab on start up?
2) As a follow up to 1) above, a former poster had made the following recomendation - "I would put conditional formating that will make the cells all black if the NOW() function is pass certain date. And maybe put a red statement saying it expires. Make sure you put a password so people cant edit it". The question is how would I add conditional formatting? (at the risk of stating the obvious - I'm not an Excel or VBA expert)
The code I am using is (also from a helpful previous poster):
Aut
ActiveWorkbook.PrecisionAsDisplayed = False
If Date < #3/26/2009# Then Exit Sub
Bye_Message
With ThisWorkbook
.Saved = True
.ChangeFileAccess xlReadOnly
‘ Kill .FullName
.Close False
End With
End Sub
Bye_Message()
'Self-Destruct Final Message no response needed, just OK
ln1 = "This spreadsheet has a defined expiration date which has expired. After the expiration"
ln2 = "date the spreadsheet will not function. Your data will not be lost. Send the file to the"
ln3 = "author to request an updated copy."
In4= “ “
ln5 = "Author is Greg Test (test@yahoo.com / msg = ln1 & vbCr & ln2 & vbCr & ln3 & vbCr & ln4 & vbCr & ln5
style = vbOKOnly + vbInformation
Title = "International Test Consulting, LLC© December 2008, by Greg"
MsgBox msg, style, Title
End Sub
Any help would be appreciated.
Greg Lamberson, BS, MBA
Consultant - Upstream Energy
Website: