View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kent Prokopy Kent Prokopy is offline
external usenet poster
 
Posts: 39
Default Excel Expiration

Add the following code to the ThisWorkBook module:

Private Sub Workbook_Open()
Dim OpenCount As Integer
OpenCount = GetSetting("MyApp", "Count", "OpenCount", 0)

SaveSetting "MyApp", "Count", "OpenCount", OpenCount + 1

If OpenCount = 10 Then ThisWorkbook.Close SaveChanges:=False

End Sub

Then lock the project from viewing. After the workbook has been opened 10
times it will automaticly close.

"Hamed parhizkar" wrote:

I have made a spreadsheet for someone, they want to see it before I go over
there and install it but I dont want him to just steal it if I email it. Is
there anyway that the sheet can expire after a number of times the sheet is
opened or based on date?