Try this dallas
Sub MakeDirectory()
Dim Dirname As String
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
Dirname = "C:\MyDir"
If Not fs.FolderExists(Dirname) Then
fs.CreateFolder Dirname
Else
' do nothing
End If
End Sub
--
Regards Ron de Bruin
http://www.rondebruin.nl
"dallas " wrote in message ...
I create new Folder.
Private Sub Workbook_Open()
Dim strMyFolder As String
strMyFolder = "C:\Spelade"
MkDir strMyFolder
End Sub
but next time Workbook_Open if Folder "C:\Spelade" exist
I want to Exit Sub
How?
Private Sub Workbook_Open()
If ####Folder "C:\Spelade" exist####
Exit Sub
Else
Dim strMyFolder As String
strMyFolder = "C:\Spelade"
MkDir strMyFolde
End If
End Sub
/dallas
---
Message posted from http://www.ExcelForum.com/