Timebomb protection of Code

  • Thread starter Thread starter Frans Verhaar
  • Start date Start date
F

Frans Verhaar

Hi,

I am writing a little VBA application and will sell this to a small company.
However, I want to give them a license to use it only for 3 months.
How can I make sure the application will not work anymore after 3 months?

And how can I program something that will clear the whole VBA code if
somebody tries to break into the code?

Regards,
Frans
 
Hi Frans

There is always a way to use your workbook if anybody wants it.
VBA is not safe.

Be sure that your workbook is only usefull if they enabled macro's

But most people you can fool with something like this that close the workbook
after the date.

Put this in the workbook open event of the workbook.
After the date the file will be closed when you open it.

Private Sub Workbook_Open()
If Date > DateSerial(2003, 4, 1) Then
ThisWorkbook.Close savechanges:=False
End If
End Sub

This you can use to kill the file

Private Sub Workbook_Open()
If Date > DateSerial(2003, 4, 1) Then
ThisWorkbook.ChangeFileAccess xlReadOnly
Kill ThisWorkbook.FullName
ThisWorkbook.Close False
End If
End Sub
 
Simplest way to make it foolproof is put some or most of the code in a VB6
ActiveX dll and
make all the functions/subs exit with a message when it is past the date.
Any protection that relies on VBA code is very easy to crack.

RBS
 
I am not afraid of that.
The fact that they hire me to write this relatively simple code, means that
they will probably not be able to crack it themselves, let alone receive any
additional support from me...

However,
Is there not a code that on a workbok open event can delete all code in VBA
when it is past a certain date, and than save the workbook immediately?

It is like an auto destruct. How would I formulate such an auto delete of
code / modules?

Regards,
Frans
 
Hi Frans

By legal default, the one (person/company/...) that pays you to write the
code, is the owner the code. Not the author/programmer. If you sell time or
labor then you do not own the code you write. So make sure your agreement
with your customer makes you the owner and allows you to put time bombs into
it if you choose that approach.

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