Hi,
I have a userform that creates scenarios. In order to save them there are two options:
Set fso = CreateObject("Scripting.FileSystemObject")
it with fso.deletefolder("path") create it with fso.createfolder("path")
- If the folder named [scenario] doesn't exist, create it with fso.createfolder("path")
- If the folder named [scenario] exists, delete
Pretty simple.
The tricky part is that at some point it started popping an error message for option 2 saying it coulnd't create the folder because it already existed, but there wasn't any folder. Moreover, once I tried to delete the main folder where I as saving these folders it turned out I can't and Windows pops the following error message:
But it's empty! It seems the one way to delete this folder is to do it in safe mode. Was this caused by the createfolder method? Thank you in advance.Quote:
An unexpected error is keeping you from deleting the folder. if you continue to receive this eror, you can use the code to search for help with this problem.
Error 0x80070091: The directory is not empty
Regards,
Samuel
