LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default How to bypass MkDir when that Dir exists already

"Jan Nademlejnsky" schrieb im Newsbeitrag
...
I have macro which creates Subdirectories. I need to bypass MkDir command if
that folder already exists. How do you do that?

Thanks for your help.

Jan



As others already sugested, check if the Dir exists.

Or try to create the Dir and simply ignore the error:

On Error Resume Next 'instruct VBA to ignore any error
MkDir "MyNewSubdir"
On Error GoTo 0 'no error handling
or
On Error GoTo MyErrorHandler 'reenable your previous
'error handling

Helmut.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MkDir question Jim G Excel Programming 6 December 4th 08 07:58 PM
Problems with MkDir steve_doc Excel Programming 3 July 19th 07 02:50 PM
mkdir Peter[_61_] Excel Programming 2 May 12th 07 12:48 PM
mkdir problem Tom Ogilvy Excel Programming 2 August 31st 04 03:22 PM
mkdir problem Norman Jones Excel Programming 0 August 30th 04 04:37 PM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"