View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Paul B[_6_] Paul B[_6_] is offline
external usenet poster
 
Posts: 135
Default create new Folder

Dallas, how about something like this

Private Sub Workbook_Open()
If Dir("c:\Spelade", vbDirectory) = vbNullString Then _
MkDir "c:\Spelade"
End Sub

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
"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 strMyFolder
End If
End Sub



/dallas


---
Message posted from http://www.ExcelForum.com/