View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chong Moua[_2_] Chong Moua[_2_] is offline
external usenet poster
 
Posts: 5
Default 2 questions - Creating a TimeBomb - Securing Code

Try this...
------------------------
Private Sub Workbook_Open()

Dim Expire As Date

Expire = #10/31/2003#

If Now < Expire Then
MsgBox "Your spreadsheet application will expire on: "
& Expire
Else
MsgBox "Your spreadsheet application has expired!",
vbCritical
ThisWorkbook.Close
End If

End Sub
------------------------
Hope this helps...

Chong Moua


-----Original Message-----
I have two questions, I have created a mini VBA
application as a qualifying tool. I would like for that
application to stop working after a given date, so users
are forced to come back to me for the most current

version
of the application. I had considered placing an if then
statement in the userform initialize area, so if the
system date is greater than the preset time, they would
receive an error message directing them back to me for an
updated copy. Could someone give me an idea of the code
that would accomplish this task, or alternately if there
are other ideas on how to achieve the end result, that
would also be greatly appreciated.

Part 2, is anyone aware of a good source of information

on
how to practically protect users from accessing the VBA
code area of the document. I also know that this
protection is moderate at best, but a low hurdle for the
casual user should be good enough for this application.

Thanks for any assistance

Dave
.