View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default limiting number of uses

CB

Private Sub Workbook_Open()
With Sheets("Sheet1").Range("A1")
If .Value = "" Then
.Value = 1
Else
.Value = .Value + 1
End If
End With
End Sub

Copy/paste into Thisworkbook module.............edit sheetanme and range to
suit.


Gord Dibben MS Excel MVP

On Wed, 16 Jul 2008 13:29:02 -0700, CB wrote:

In a similar fashion I just want to count the number of times a file is
opened. Can you give me a little more direction on the command to
"increment" when the file is opened? Thank you

"XP" wrote:


In this forum I'm likely to be spanked on this reply, but I think there are
only superficial ways to do this. By superficial I mean that no matter what
you come up with it can probably be hacked and easily circumvented.

If all you need is a superficial way of telling a user that their input is
no longer desired there are probably a lot of ways to accomplish this. You
could store a number in a hidden worksheet that is incremented on open. The
code could then use this as a check digit and if it is greater than your
limit then display a message and exit.

You could also store information in a custom document property and retrieve
it to compare a drop dead date or again a counter of some sort.

HTH

"Glenn" wrote:

I have a program I am going to send for review. My question is how can I set
up the workbook to not allow access after a certain number of times the
program is opened or how can i limit the number of days the program can be
accessed?
Thanks for you help
Glenn