Solved

add a password to open excel after 60 days

Posted on 2016-10-19
8
36 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 29

Expert Comment

by:ScottCha
Comment Utility
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
Comment Utility
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 29

Accepted Solution

by:
ScottCha earned 500 total points
Comment Utility
0
 

Author Comment

by:drelinger
Comment Utility
To clarify.  I would set the expiration date in code.
I'd like a password added to the file on a particular date.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Closing Comment

by:drelinger
Comment Utility
wow, that's perfect.. and small code...
Thanks much.
Mark
0
 
LVL 29

Expert Comment

by:ScottCha
Comment Utility
Glad I could help.
0
 
LVL 17

Expert Comment

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

Expert Comment

by:ScottCha
Comment Utility
I've never had a problem before.  I simply referenced what I found to not run into copyright issues.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now