Gold_Ninja
New Member
- Joined
- Oct 22, 2012
- Messages
- 21
I have a spreadsheet and some associated documents in a folder and I want to move them into another folder with a macro.
I quickly found out I could not use FSO.MoveFolder on the folder containing the excel sheet running the macro (It should have been obvious!).
So I opted to saveAs the excel sheet to a temporary folder, FSO.copyFolder everything to the new folder, saveAs the excel sheet into the new folder and delete the temporary sheet. I then FSO.deleteFolder the old folder (now empty) and everything should be fine.
Except: I cannot delete the folder which used to contain the spreadsheet running the macro. I get Error 70: Permission denied. The folder is empty but read-only and cannot be changed/deleted/opened while Excel is running.
Does anyone have any idea how I could release this folder from Excel's grasp?
I hope this makes sense, thanks in advance for any help offered and let me know if you need some more information.
Joel
I quickly found out I could not use FSO.MoveFolder on the folder containing the excel sheet running the macro (It should have been obvious!).
So I opted to saveAs the excel sheet to a temporary folder, FSO.copyFolder everything to the new folder, saveAs the excel sheet into the new folder and delete the temporary sheet. I then FSO.deleteFolder the old folder (now empty) and everything should be fine.
Except: I cannot delete the folder which used to contain the spreadsheet running the macro. I get Error 70: Permission denied. The folder is empty but read-only and cannot be changed/deleted/opened while Excel is running.
Does anyone have any idea how I could release this folder from Excel's grasp?
I hope this makes sense, thanks in advance for any help offered and let me know if you need some more information.
Joel