Macro Suggestion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am sending an .xls file via email as an attachment. The excel file
contains data that a client has purchased. I would like to make the data
unusable after a certain amount of time has passed and or password protect
the file. Any suggestions would be appreciated.
 
None of these measures will really work. Excel data cannot really be
secured. What's to prevent the client from just printing it out?
__________________________________________________________________________
 
Aaron,

There is really no good, secure, way to do that. Passwords are easily broken
and expiry dates can be changed in the registry and macros can be disabled.
A reasonably experienced user can get past whatever protection you put it,
if they are so inclined. That said, if you want some simple code that will
work for most casual users, try something like the following. It will close
the workbook if it is opened more than 30 days past the date it is first
opened.


Sub Auto_Open()
Const APP_NAME = "YourAppName"
Const SECTION = "Setup"
Const KEY = "Expiration"
Const EXPIRE_DAYS = 30
Dim V As Variant
V = GetSetting(APP_NAME, SECTION, KEY, "-1")

If IsNumeric(V) Then
If CLng(V) <= 0 Then
V = CLng(Now + EXPIRE_DAYS)
SaveSetting APP_NAME, SECTION, KEY, CStr(V)
Else
If V <= Now Then
MsgBox "Time Expired. Workbook wil close."
ThisWorkbook.Close savechanges:=False
End If
End If
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
 
Thanks for the code Chip!
I am developing a web based application were, as I have elluded to, clients
are purchasing phone number data. Can you think of a better way to deliver
the data so that the end user will not be able to easily duplicate it (even
above and beyond a copyright infringment notification)?
 
Aaron said:
I am developing a web based application were, as I have elluded to,
clients are purchasing phone number data. Can you think of a better
way to deliver the data so that the end user will not be able to easily
duplicate it (even above and beyond a copyright infringment
notification)?
....

ANYTHING a user can see on his/her monitor can be saved to text files over
which you couldn't LEGALLY exercise any control. OCR is widely enough
available that you have no hope of finding effective means to limit the
usable lifetime for any data you provide that could be viewed on screen.

Time to reassess your buisness model.
 

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