G
Guest
I need to be able to kill a file once I have saved a copy of it to it's new
location.
I can save a copy from within the file and I can kill it from my desktop
(executing the same code) . When I go to kill from within the folder I get a
Permission Denied (Error 70) appearing. I am the owner / creator of the
folders and have full control of them. I can delete anything with mouse
clicks but not with code from within the folder.
The code I am using is as follows:
Sub DeletethenSaveFile()
Folderdetails = " Filepath and Name"
ThisWorkbook.SaveCopyAs "New Filepath and Name"
MsgBox "Your file has been saved to it's new location"
On Error Resume Next
Kill Folderdetails '"Filepath and Name"
MsgBox "The requested file has been deleted"
MsgBox "This file will now close"
ThisWorkbook.Close SaveChanges = False
End Sub
Please help me!!! D
location.
I can save a copy from within the file and I can kill it from my desktop
(executing the same code) . When I go to kill from within the folder I get a
Permission Denied (Error 70) appearing. I am the owner / creator of the
folders and have full control of them. I can delete anything with mouse
clicks but not with code from within the folder.
The code I am using is as follows:
Sub DeletethenSaveFile()
Folderdetails = " Filepath and Name"
ThisWorkbook.SaveCopyAs "New Filepath and Name"
MsgBox "Your file has been saved to it's new location"
On Error Resume Next
Kill Folderdetails '"Filepath and Name"
MsgBox "The requested file has been deleted"
MsgBox "This file will now close"
ThisWorkbook.Close SaveChanges = False
End Sub
Please help me!!! D