macro to time limit workbook

D

ditchy

Hello there, is there a way for a macro, or does someone have a macro
to time limit a workbook, say three to five days. Similar to a 30 day
trial limit.
all help appreciated
regards, Ditchy
 
H

Harald Staff

Hi Ditchy

In its very simplest form (goes into the thisworkbook module):

Private Sub Workbook_Open()
If Date > DateSerial(2005, 5, 1) Then
MsgBox "Trial period has expired", vbInformation
Me.Saved = True
Me.Close
End If
End Sub

What you have to do is find ways to
- ensure that macros are enabled by the user (usually done by making the
file worthless without macros),
- register and store the first date when the user tests the file,
- read time from the internet so that changing the system date won't help,
- copy protect the file and all parts of its content

HTH. Best wishes Harald
 
D

ditchy

Thank you Harald for the info,
another question if I may. How do I (make the file worthless without
macros) ?
This may be a better option for me
regards
Ditchy
 
H

Harald Staff

That is a good, common way, yes. The general idea is to break something in
the Close macro that you fix in the Open macro -unless time is expired or it
isn't paid for or whatever. Breaking things like that is creative and fun to
program.

Note that these things aren't extremely safe, skilled excel users, like the
ones you find here, will have few problems breaking into your file. But for
the target audience "users" it's sufficient.

HTH. Best wishes Harald
 
Top