I want to delete a specific folder on the C drive (but not when running the
macro on a network), using the following code:
If FObject.GetDrive(FObject.GetDriveName(ELP)) = "C:" And Dir(WIP) <> ""
Then
FObject.DeleteFolder WIP, True
End If
Dir confirms that the folder is present, but DeleteFolder gives me error 76
(Path not found). When removing the path seperator by adding the code
WIP = Left(WIP, Len(WIP) - 1)
before the DelteFolder command, the error changes to 70 (permission denied.
ELP = the Excel Library Path which I use to determine if the macro is running on
c drive or a network.
WIP = "C:\windows\temp\~wqn\" which is directory containing different files,
including read-only files and being created during a file install process. It
has to be removed after installation is complete. I have to add that none of the
file in WIP is open by any application or running.
Does anybody has an idea what the problem is, and wy deleting the entire folder
doesn't work?