gleamng
Board Regular
- Joined
- Oct 8, 2016
- Messages
- 98
- Office Version
- 365
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
- 2003 or older
- Platform
- Windows
- MacOS
- Mobile
- Web
Hi everyone, I hope you are all doing great.
Please help me out with this error code.
I tried using the kill command but it return "runtime error 70 - permission denied" , meanwhile the file i have the macro is also in the same folder and to be deleted as well at a particular date. Below is my code
Sub expiry()
Dim expiry as Date
Expiry = "26 Feb, 2023"
If Date > Expiry Then
Kill "D:\Google Drive\MSC\*.*"
End If
End Sub
Please help me out with this error code.
I tried using the kill command but it return "runtime error 70 - permission denied" , meanwhile the file i have the macro is also in the same folder and to be deleted as well at a particular date. Below is my code
Sub expiry()
Dim expiry as Date
Expiry = "26 Feb, 2023"
If Date > Expiry Then
Kill "D:\Google Drive\MSC\*.*"
End If
End Sub