Create Folder.....

  • Thread starter Thread starter Paiolas
  • Start date Start date
P

Paiolas

Hi.

I want to creat a folder in a specific path if this
folder doesn´t already exists
Im trying the following code but i just can get it to
work (and i dont understand the "OBJECT")

If Object.FolderExists(ThisWorkbook.Path & "\" & "Temp")
= False Then
MkDir ThisWorkbook.Path & "\" & "Temp"
End If

Thanks a lot
Paiolas
 
Try this Paiolas

Sub MakeDirectory()
Dim Dirname As String
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
Dirname = "C:\Data"
If Not fs.FolderExists(Dirname) Then
fs.CreateFolder Dirname
' your code
Else
' your code
End If
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)




Hi.

I want to creat a folder in a specific path if this
folder doesn´t already exists
Im trying the following code but i just can get it to
work (and i dont understand the "OBJECT")

If Object.FolderExists(ThisWorkbook.Path & "\" & "Temp")
= False Then
MkDir ThisWorkbook.Path & "\" & "Temp"
End If

Thanks a lot
Paiolas
 
Back
Top