andymunden
Programmer
I am writing a VBA macro for Word which creates a temporary folder, creates some files in it, and later deletes the files and attempts to delete the folder. The name of the folder is held in the string variable TEMP_SAVE_FOLDER. I am using the following code to attempt to delete all files in the folder and then the folder itself:
ChDir TEMP_SAVE_FOLDER
On Error Resume Next
Kill "*.*"
On Error GoTo 0
RmDir TEMP_SAVE_FOLDER
However despite the fact that I successfully delete all files in the folder I get error 75 - path/file access error when I attempt the RmDir.
I can only delete the folder once I have exited Word.
Any help with resolving this would be greatly appreciated.
ChDir TEMP_SAVE_FOLDER
On Error Resume Next
Kill "*.*"
On Error GoTo 0
RmDir TEMP_SAVE_FOLDER
However despite the fact that I successfully delete all files in the folder I get error 75 - path/file access error when I attempt the RmDir.
I can only delete the folder once I have exited Word.
Any help with resolving this would be greatly appreciated.