Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Create Folder.....

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Create Folder.....

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)
www.rondebruin.nl



"Paiolas" wrote in message ...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CREATE A FOLDER AUTOMATICALLY pravin New Users to Excel 5 July 16th 09 09:31 AM
how to create password for an folder C.M.[_2_] New Users to Excel 1 July 21st 08 11:50 AM
automatically folder create hitesh Excel Discussion (Misc queries) 1 January 2nd 08 11:52 AM
Create Folder Using VBA DoooWhat Excel Discussion (Misc queries) 5 September 21st 07 10:28 PM
create folder and save as runandrun Excel Discussion (Misc queries) 10 September 23rd 05 11:40 PM


All times are GMT +1. The time now is 05:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"