countryfan_nt
Well-known Member
- Joined
- May 19, 2004
- Messages
- 765
Hello friends, hope all is well!
Please help me; I keep getting the error:
compile error wrong number of arguments or invalid property assignment.
the word Kill is highlighted in yellow.
thank you very much in advance!
Please help me; I keep getting the error:
compile error wrong number of arguments or invalid property assignment.
the word Kill is highlighted in yellow.
thank you very much in advance!
Code:
Private Sub Workbook_Open()
Dim sht As Object
Dim Edate As Date
Edate = Format("" & Sheets("Introduction.").Range("h28").Value&, "DD/MM/YYYY") ' Replace this with the date you want
If Date > Edate + 2 Then
Application.DisplayAlerts = False
ThisWorkbook.ChangeFileAccess xlReadOnly
Kill ThisWorkbook.FullName
ThisWorkbook.Close False
End If
Last edited: