how can i make a file only open for 14 days then lock

sleepers

Board Regular
Joined
May 26, 2004
Messages
203
can i make a macro that you can set the start date and then it will need a password after 14 days to open
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Maybe something like this
Code:
Private Sub Workbook_Open()
    Dim Startdate As Date
    Startdate = "11/4/05"
    If Now() < Startdate + 14 Then Exit Sub
    If InputBox("File Is Locked. Enter Password to open.", "Password", "") <> "password" Then
    MsgBox ("Incorrect Password. File will close")
    Me.Close
    Exit Sub
    End If
End Sub
You can also set StartDate by referencing a cell in the WorkBook
 

Watch MrExcel Video

Forum statistics

Threads
1,118,056
Messages
5,569,953
Members
412,299
Latest member
agentless
Top