filesystemobject

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

If i use
fso.Createfolder "c:\" & tt & tal & kur1

How can i make a msgbox and exit if the folder allready exits

Regards

alvin
 
fso.GetFolder("c:\" & tt & tal & kur1) returns an error if the foler does not
exist, so,

On Error goto NoFolder

Set FolderObj = fso.GetFolder("c:\" & tt & tal & kur1)
MsgBox "Folder already exists!"
Exit Sub

NoFolder:
fso.Createfolder "c:\" & tt & tal & kur1
....
 
Thanks
its working

Alvin


"K Dales" skrev:
fso.GetFolder("c:\" & tt & tal & kur1) returns an error if the foler does not
exist, so,

On Error goto NoFolder

Set FolderObj = fso.GetFolder("c:\" & tt & tal & kur1)
MsgBox "Folder already exists!"
Exit Sub

NoFolder:
fso.Createfolder "c:\" & tt & tal & kur1
...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

copy folder 1
Please help with do while 1
Deletefolder 9
Filesystem again 1
maybe to bob phillips -next folder? 2
Please help with do while 3
loop and some more 6
Automatically create folder on SharePoint 1

Back
Top