Message 1 of 12
expiry date for trial macro
Not applicable
12-02-2009
02:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am looking for a couple of lines of code which will check the current date and if it is before then ok if the date is 29/12 or past the msg box "trial has expired" displays.
I have got this far but dont know what to do in the highlighted lines see Sub NewId
Thanks in anticipation
At this stage disregard the function foo below as this sets expire and gets current date ok
jb
Function foo()
Dim ExpireDate As String
Dim CurrentDate As String
ExpireDate = "20091130.0634455"
CurrentDate = ThisDrawing.GetVariable("cdate")
End Function
Sub NewId()
ExpireDate = "20091130.0634455" 'set expire date
CurrentDate = ThisDrawing.GetVariable("cdate") 'get current date
how do i check current date against expire date next line
If "CurrentDate" is ???????????????????????????????? before "ExpireDate" Then 'compare two dates
MsgBox "success"
Else
MsgBox "Your trial has expired"
End If
End Sub
I have got this far but dont know what to do in the highlighted lines see Sub NewId
Thanks in anticipation
At this stage disregard the function foo below as this sets expire and gets current date ok
jb
Function foo()
Dim ExpireDate As String
Dim CurrentDate As String
ExpireDate = "20091130.0634455"
CurrentDate = ThisDrawing.GetVariable("cdate")
End Function
Sub NewId()
ExpireDate = "20091130.0634455" 'set expire date
CurrentDate = ThisDrawing.GetVariable("cdate") 'get current date
how do i check current date against expire date next line
If "CurrentDate" is ???????????????????????????????? before "ExpireDate" Then 'compare two dates
MsgBox "success"
Else
MsgBox "Your trial has expired"
End If
End Sub