I will be amazed if it can be done!!!!!!!!!!!!

imranrashid

New Member
Joined
Mar 26, 2002
Messages
3
I am working on a microsoft EXCEL file. This file contains calculations.

I want to distribute this file through my website but at the same time I want my clients to download new version every six months.

Now the problem is that I want this excel file to stop working on a specified future date. It could be in either way:
- to lock the file automatically on a specified date; or
- to delete the file on a specified date; or
- to lock and show a specified worksheet only with message that the file has expired and how to get new version
- to lock all sheets except one
etc.......

Please help me how to do this.

Any other way to get this function and the results...

Imran Rashid
http://www.exportfinance.com.pk
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
On 2002-03-27 12:01, imranrashid wrote:
I am working on a microsoft EXCEL file. This file contains calculations.

I want to distribute this file through my website but at the same time I want my clients to download new version every six months.

Now the problem is that I want this excel file to stop working on a specified future date. It could be in either way:
- to lock the file automatically on a specified date; or
- to delete the file on a specified date; or
- to lock and show a specified worksheet only with message that the file has expired and how to get new version
- to lock all sheets except one
etc.......

Please help me how to do this.

Any other way to get this function and the results...

Imran Rashid
http://www.exportfinance.com.pk

i am sure this can be done by using the ontime method, look it up in help as a starting point.
 
Upvote 0
Easiest thing to try would be to add some code in the Workbook_Open event, first thing, test the date against your die date, and prompt a msg then exit the workbook.

If Now() >= CDate("6/27/02") then
MsgBox "Get a new copy"
me.close
end if
 
Upvote 0
You could check at open the date versus the date that the file stops working, which could be located in a hidden sheet, or in the registry or in a text file...

One thing, Excel isn't the most secure tool... what I mean is, if someone wants to get it, they can.
 
Upvote 0
Hi imranrashid

There quite a few ways this could be done, most far from fool-proof though. The code below is just one of many ways. This code must be placed in the Private Module of "ThisWorkbook".


Private Sub Workbook_Open()
Dim stPass As String
Dim stDate As String
Dim wsSheet As Worksheet

On Error Resume Next
Application.DisplayAlerts = False
Sheets.Add().Name = "DateChecker"
If ActiveSheet.Name <> "DateChecker" Then ActiveSheet.Delete

Sheets("DateChecker").Visible = xlVeryHidden
If Sheets("DateChecker").Range("A1") = "" Then
Sheets("DateChecker").Range("A1") = Date
Me.Save
End If

If Sheets("DateChecker").Range("A1") + 30 > Date Then
Sheets.Add before:=Sheets(1)
For Each wsSheet In Me.Worksheets
If wsSheet.Index <> 1 Then wsSheet.Delete
Next wsSheet
Application.DisplayAlerts = True
Me.Save
End If

End Sub

The code will add the date to a hidden sheet the first time they open the file. From then on it will check the date each time they open. If the date on the hidden sheet is greater than 30 days old the code adds a sheet(Excel requires at least one visible sheet), then deletes all others. This may of course be a bit dramatic for your needs, but hopefully it will get you started.
 
Upvote 0

Forum statistics

Threads
1,213,524
Messages
6,114,117
Members
448,549
Latest member
brianhfield

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top