Solved

add a password to open excel after 60 days

Posted on 2016-10-19
8
41 Views
Last Modified: 2016-10-19
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
Comment
Question by:drelinger
8 Comments
 
LVL 30

Expert Comment

by:Scott C
ID: 41850114
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
 
LVL 23

Expert Comment

by:Brian B
ID: 41850115
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
 
LVL 30

Accepted Solution

by:
Scott C earned 500 total points
ID: 41850123
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:drelinger
ID: 41850124
To clarify.  I would set the expiration date in code.
I'd like a password added to the file on a particular date.
0
 

Author Closing Comment

by:drelinger
ID: 41850127
wow, that's perfect.. and small code...
Thanks much.
Mark
0
 
LVL 30

Expert Comment

by:Scott C
ID: 41850135
Glad I could help.
0
 
LVL 18

Expert Comment

by:Roy_Cox
ID: 41850582
Are links to other Forums allowed, I was told not! Apparently I am not even allowed to link to my own site.
0
 
LVL 30

Expert Comment

by:Scott C
ID: 41850627
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question