Delete excel file

Microsoft Windows xp inside out, second...
July 5, 2010 at 02:29:46
Specs: Windows XP, pentium 4 3.00Ghz. 1gb ram
I want to delete excel file say ABC.xls on date 25/6/2011 but with an option to extend it another 40 days if correct password is entered on the pop up box. Delete file on wrong password.That is a pop up box to enter password should appear on 25/6/2011.

How to achieve this using VBA?

See More: Delete excel file

July 5, 2010 at 04:18:13
re: That is a pop up box to enter password should appear on 25/6/2011.

Where/when do you want this pop-up to appear?

I know you said on 25/6/2011 but is it supposed to appear when any Excel file is opened on that day or the ABC.xls file or something else?

What do you want to happen if the file isn't opened on 25/6/2011? Would the same 40 day rule apply if it was opened on 26/6/2011 or would it be reduced to 39 days?

We need as many specific details as you can provide so that we can offer a proper solution.

Report •

July 5, 2010 at 23:01:40
Thanks for your response DerbyDad03.

Pop up to appear only on ABC.xls if i open it on or after 25/6/2011. The same 40 days rule may apply if i open ABC.xls on or after 25/6/2011

I have the following code which have demerits

Private Sub Workbook_Open()
  With ThisWorkbook
    Application.DisplayAlerts = False
      If Date > DateSerial(2011, 6, 25) And .Path <> vbNullString Then
       .ChangeFileAccess xlReadOnly
       Kill .FullName
      End If
     ThisWorkbook.Close SaveChanges:=False
    End With
End Sub 

The demerits are:
1. All sheets are hidden and no new sheet can be inserted even before 25/6/2011 is reached.
2. I don't know how to add line(s) to appear pop up box on or after 25/6/2011 on which if correct password is entered the 40 days of extended life of ABC.xls may be achieved.

Report •

July 9, 2010 at 02:27:10
m just using ur code with small modification but though to crack 40 days. may god bless u

Report •
Related Solutions

Ask Question