Using Excel VBA I want to programetically create a folder "MyTest" at C:\Excel if it already doesn't exist?
I will appreciate your help.
Using Excel VBA I want to programetically create a folder "MyTest" at C:\Excel if it already doesn't exist?
I will appreciate your help.
Maybe this may help:
Path = "C:\Excel\MyTest" If Dir(Path, vbDirectory) = vbNullString Then MkDir sPath End If
Last edited by fron; 05-24-2007 at 03:45 AM.
Use the MkDir Function
It might be better to test if the Directory existsMkDir "c:\Excel\Test"
If Len(Dir("c:\Excel\Test", vbDirectory)) = 0 Then MkDir "c:\Excel\Test" End If
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks