code to terminate access after certain time

B

bruce forster

I am creating a program to be distributed to other users via cd. is there anyway to have the program terminate after a certain time so that the person can not go to another employer and use the program?

Thanks
 
B

Bob Phillips

Look at the OnTime method in help , or see Chip's page at
http://www.cpearson.com/excel/ontime.htm

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

bruce forster said:
I am creating a program to be distributed to other users via cd. is there
anyway to have the program terminate after a certain time so that the person
can not go to another employer and use the program??
 
M

mudraker

Try this

Sub Auto_Open()
If Now() > "25/04/2004" Then
ThisWorkbook.Close savechanges:=False
End If
End Su
 
D

David Adamson

for certain time I am assuming that you mean days

A know it can be done via date for a demonstration file and put it in the
Auto_Open and/or Close function

I think if you use the DateDiff(interval, date1, date2[, firstdayofweek[,
firstweekofyear]])

What you do is check if the difference bewteen the two dates has expired and
run what you want to happen.

However, if the person knows this all they have to do is reset the date on
their computer to get around this.

If you want the program to close after a number of minutues try searching
for "splash screen" as that displays a userfrom for a few seconds.



bruce forster said:
I am creating a program to be distributed to other users via cd. is there
anyway to have the program terminate after a certain time so that the person
can not go to another employer and use the program??
 
B

Bob Phillips

Sorry mis-read it.

You can put various snares in the code, but none are reliable as the Excel
security model is very weak, and easily circumvented. The only safe way is
to build a VB application that you can compile as an executable or a DLL and
secure that.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top