Add a sub folder

F

Fan924

I want to use a macro to add a sub directory. Hod do I check to verify
that it does not already exist before adding directory? TIA
 
H

Harald Staff

Fan924 said:
I want to use a macro to add a sub directory. Hod do I check to verify
that it does not already exist before adding directory? TIA

You could use Dir for that. But you don't have to, MkDir will err and create
nothing if the folder already exists. Just allow it to:

On Error Resume Next
MkDir ("C:\Temp")

HTH. Best wishes Harald
 

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

Top