Expiry date with password

cobwebs2222

New Member
Joined
Nov 24, 2008
Messages
16
hi people,

Ive been trying to do this for ages now, but decided i need further help!
Im fairly new to VB but getting the hang of it, however this one gets passed me.

I have made a spreadsheet that works out figures and conversion rates and stuff, however i would like it to expire with the option of a password lets say for example after 30 days, this will effectivly dissable, or close the spreadsheet down until a password is put in, then it will all come back to life.

ive been trying to think of a way round this now for days, but headache after headache i still cant get it to work. The formula doesnt have to be that secure, as the people using it im certain would never even look for it untill its too late!


I really hope some one out there can help me

and any suggestions would be most welcome.

Cheers x
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
hi people,

Ive been trying to do this for ages now, but decided i need further help!
Im fairly new to VB but getting the hang of it, however this one gets passed me.

I have made a spreadsheet that works out figures and conversion rates and stuff, however i would like it to expire with the option of a password lets say for example after 30 days, this will effectivly dissable, or close the spreadsheet down until a password is put in, then it will all come back to life.

ive been trying to think of a way round this now for days, but headache after headache i still cant get it to work. The formula doesnt have to be that secure, as the people using it im certain would never even look for it untill its too late!


I really hope some one out there can help me

and any suggestions would be most welcome.

Cheers x

hmmm. Maybe something like a cell somewhere that keeps track of the date, every time the sheet is opened. (Workbook_open event).

Then within that sub, check against the new date. If >30 days, hide all sheets, protect and password lock (somehow...)

Helpful?
 
Upvote 0
Hi
And welcome to the Board
Maybe something along these lines.

Code:
Sub Auto_Open() 
Dim exdate As Date 
exdate = “11/30/2008” 
If Date > exdate Then 
MsgBox (“You have reached end of your trial period”) ActiveWorkbook.Close 
End If 
MsgBox (“You have “ & exdate - Date & “Days left”)
End Sub

Regards
Michael M
 
Upvote 0
Hi
And welcome to the Board
Maybe something along these lines.

Code:
Sub Auto_Open() 
Dim exdate As Date 
exdate = “11/30/2008” 
If Date > exdate Then 
MsgBox (“You have reached end of your trial period”) ActiveWorkbook.Close 
End If 
MsgBox (“You have “ & exdate - Date & “Days left”)
End Sub

Regards
Michael M

Ah. I read the OP differently... Two distinct scenarios here: 30 days "trial period" and 30 days idle time. My first response adresses the "idle time" situation, and Michael adresses the Trial Period.
 
Upvote 0
hmmm. Maybe something like a cell somewhere that keeps track of the date, every time the sheet is opened. (Workbook_open event).

Then within that sub, check against the new date. If >30 days, hide all sheets, protect and password lock (somehow...)

Helpful?

I think this is the route id like to go down if possible, its very hard to explain what im after on here, but I think this sounds most like it. I tried the other 2 formulas but I couldnt get them to work :eeek: I must be doing something wrong, but I really do appreciate all the comments and help, just need one of them to work now, lol

Cheers x
 
Upvote 0
Hi
Sorry I haven't responded sooner, but I've been away on business.
Which formulae did you try, as I only provided a VBA routine.
and which way do you want to go with the code.

Regards
Michael M
 
Upvote 0
hiya, thnx for the reply,

I think if its at all possible, id like to go for an exipry date with a password, so for example, on the, 2nd Jan 2009, a password to come up so that the programme will no longer be usable, is thispossible???

would be great if you ould help me with this

Cheers x
 
Upvote 0
This will do what you want.
Remember to save a copy of the file first !!
You will need to change the "Password" and the exdate to suit your needs.

Keep in mind that any user can bypass this with a little bit of knowledge.
This will only keep honest people, honest.
Code:
Sub Workbook_Open()
Dim exdate As Date, ws As Worksheet, PW As String
exdate = "10/30/2008"
If Date > exdate Then
MsgBox ("You have reached the end of your trial period")
PW = InputBox("Enter password:")
If PW = "Password" Then
For Each ws In Worksheets
    ws.Unprotect
  Next ws
MsgBox ("Password is Correct, Please Proceed")
Exit Sub
End If
End If
For Each ws In Worksheets
    ws.Protect
  Next ws
MsgBox ("The Password is incorrect, This file is now locked from any further use")
End Sub

Hope this helps
Regards
Michael M
 
Upvote 0
Heya, sorry, agen been working hard

Ive tried all the formulas and I just cant get them to work, i must be doing something wrong!

wen i press F5 in VB to see if they work ok, then there fine, but wen i save it, and actually try it for real they just dont work.

any ideas?
 
Upvote 0
Where are you putting the code.
Press Alt + F11 and double click on "This Workbook" in the left hand window
paste the code in the right hand window and save.
The next time you open the workbook the code will work.

Regards
Michael M
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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