MWE
11-28-2006, 04:48 PM
I wish to create a new directory and then copy several files into it. all under VBA control. Creating the new diretory with the MkDir command works fine, but when I try to then copy files into that directory using FileCopy, I get a permissions error. When I check the permissions on the directory, it has the "partial check" for Read-Only as is true for any newly created directory. Manually creating a new directory and copying in some files (obviously) does not encounter a permissions problem.
If I split the process into three steps:
create the new directory
pause and manually remove the read-only check
copy the fileseverything works fine.
So, why does VBA get an error when I copy files into a just created directory, but other approachs do not? Is there a way to programatically remove the read-only attribute? Or is there some other way to create the directory and/or copy the files that will work better?
Thanks
UPDATE: well, the VBA gremlins seem to be at work again. I could not get MkDir and FileCopy to work at all yesterday, but today it works just fine.:dunno
If I split the process into three steps:
create the new directory
pause and manually remove the read-only check
copy the fileseverything works fine.
So, why does VBA get an error when I copy files into a just created directory, but other approachs do not? Is there a way to programatically remove the read-only attribute? Or is there some other way to create the directory and/or copy the files that will work better?
Thanks
UPDATE: well, the VBA gremlins seem to be at work again. I could not get MkDir and FileCopy to work at all yesterday, but today it works just fine.:dunno