Thread: Mk Dir
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Mk Dir

Sub Auto_Open()
On Error Resume Next
MkDir "C:\My Documents"
MkDir "C:\My Documents\Temp Me"
On Error GoTo 0

End Sub

--
Regards,
Tom Ogilvy


"Sgwapt" wrote in message
...
Hello All,

I am putting the finishing touches on my system and thought of having my
Excel file automatically make the necessary folder on another users

computer
if it does not exist. This will allow them to make their report files

using
templates associated with command buttons they press at time of need.

Currently I tried this in my Auto_Open module

'Dim Path As String
'Path = "C:\My Documents\Temp Me"
'If IsNot Path = Dir("C:\My Documents\Temp Me") Then
MkDir ("C:\My Documents\Temp Me")
'Else
'Do nothing
'End If

This makes the new folder but the next time it runs create and error.
Obviously because it already is in place......LOL on me.

What would be the correct Dim, and If statements I am looking for to make

a
directory that if is there "Do Nothing" else "Make It"? May have

application
flavor eh?

Thanks for your help

--
George G