• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 67
  • Last Modified:

add a password to open excel after 60 days

I have an excel document that I want to require a password to open after 30 days.
I don't want to kill or delete the document, just require a password.
0
drelinger
Asked:
drelinger
1 Solution
 
Scott CSenior Systems EnginerCommented:
So you don't want the document to be able to be opened UNTIL 30/60 days have passed and then only with a password?

Possibly with the workbook open event...

Private Sub Workbook_Open()
If Now > 42298 Then
    ThisWorkbook.Protect Password:="SpongeBob"
End If
End Sub
0
 
Brian BIndependant Technology ProfessionalCommented:
So no password until 30 days after creation?

You would have to have the date the workbook was made written in the sheet somewhere. A macro that runs when the file is opened could then check if the current date is 30 days after the creation date, set a password and force the file closed. However that solution has some downsides, such as requiring that somebody try to open the file before the passwords get set.

The most secure way would be if you could password protect the files without opening them. But I don't think that would be an Excel solution, it would have to happen at the windows level.
0
 
Scott CSenior Systems EnginerCommented:
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
drelingerAuthor Commented:
To clarify.  I would set the expiration date in code.
I'd like a password added to the file on a particular date.
0
 
drelingerAuthor Commented:
wow, that's perfect.. and small code...
Thanks much.
Mark
0
 
Scott CSenior Systems EnginerCommented:
Glad I could help.
0
 
Roy CoxGroup Finance ManagerCommented:
Are links to other Forums allowed, I was told not! Apparently I am not even allowed to link to my own site.
0
 
Scott CSenior Systems EnginerCommented:
I've never had a problem before.  I simply referenced what I found to not run into copyright issues.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now