MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 27th, 2002, 01:01 PM   #1
imranrashid
New Member
 
Join Date: Mar 2002
Posts: 3
Default

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
imranrashid is offline   Reply With Quote
Old Mar 27th, 2002, 01:04 PM   #2
RET79
Board Regular
 
Join Date: Mar 2002
Location: England, UK.
Posts: 526
Default

Quote:
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.
RET79 is offline   Reply With Quote
Old Mar 27th, 2002, 01:11 PM   #3
LarryJ
Board Regular
 
Join Date: Mar 2002
Location: Houston, TX
Posts: 60
Default

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
LarryJ is offline   Reply With Quote
Old Mar 27th, 2002, 01:12 PM   #4
Juan Pablo González
MrExcel MVP
 
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
Default

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.
__________________
Regards,

Juan Pablo González
http://www.juanpg.com
Juan Pablo González is offline   Reply With Quote
Old Mar 27th, 2002, 05:50 PM   #5
Dave Hawley
Banned
 
Join Date: Feb 2002
Posts: 1,582
Default

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.


Dave Hawley is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 11:20 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes