macro to time limit workbook

  • Thread starter Thread starter ditchy
  • Start date Start date
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
 
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top