View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Creating a folder

Use Dir

Sub test()

' I want to creat a folder if that folder doesn't exist in the path.
' The following statement is not supported. What is the right way?, Please.

If Dir("C:\Mybackup\") = "" Then
MkDir ("C:\temp\Mybackup\")
End If
End Sub

"dan" wrote:

Sub test()
' I want to creat a folder if that folder doesn't exist in the path.
' The following statement is not supported. What is the right way?, Please.

If Not Application.exist("I:\Mybackup\") Then MkDir ("I:\Mybackup\")
End Sub