ROY UK kindly gave me a solution regarding expiry dates on an excel spread sheet using this coding, fantastic and works the only problem is,if the security setting on someone's machine is set to high the macro doesnt work and they can disable them so the time bomb does not work , i have set auto_run but this does not solve it
Private Sub Workbook_Open()
'check if a start date exists
If IsEmpty(Sheets("Hidden").Cells(1, 1)) Then
'none exists so add today's date
Sheets("Hidden").Cells(1, 1).Value = Date
'if a start date has been recorded, check if it is less than 30 days from start
ElseIf Date >= Sheets("Hidden").Cells(1, 1).Value + 2 Then
'alert user that it has expired
MsgBox "Trial period has expired ", vbOKOnly, "Trial Period Expired"
'close the workbook without saving
ThisWorkbook.Close (False)
End If
End Sub
Bookmarks