Re: Troubles with Mkdir - WAS: Folder locked when using Open Statement twice

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Are you using Dir() at any point in your code to check if the file exists?

'like this?
blnDirExists = Dir$("C:\temp\testlock", vbDirectory)
blnFileExists = Dir$("C:\temp\testlock\test.ini")

If either of those is true, Dir() itself is what's locking the file/folder.
You must issue another Dir() with no parameters so that it continues getting
then next file (which there shouldn't be one, since you didn't use any
wildcards). Then it knows it's done, and will release the lock.



Rob


.



Relevant Pages