I would like to create a directory and a subdirectory with the following code:
Public fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
fso.CreateFolder ("C:Users<my_username>DataEntrylogs")
I am trying to create nested directories. In this case, the DataEntry
directory would not exist, so essentially I would like to create 2 directories, DataEntrylogs
under C:Users<username>
If I enter command prompt, I can create that directory with mkdir
without any issues. However, I simply cannot get VBA to create that folder and I get:
Run-time error '76':
Path not found
I am using Excel VBA 2007/2010
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…