Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Barb
You can find code on this page to test http://www.rondebruin.nl/exist.htm One way is this Sub Test_Folder_Exist_FSO_Late_binding() 'No need to set a reference if you use Late binding Dim FSO As Object Dim FolderPath As String Set FSO = CreateObject("scripting.filesystemobject") FolderPath = "C:\My Folder" If Right(FolderPath, 1) < "\" Then FolderPath = FolderPath & "\" End If If FSO.FolderExists(FolderPath) = False Then FSO.CreateFolder (FolderPath) Else MsgBox "Folder exist" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Barb Reinhardt" wrote in message ... I'd like to test for a folder path (Z:\FolderName) and if it doesn't exist, I'd like to create it. Can someone provide a snippet of code on how to do this? Thanks, Barb Reinhardt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save file in a new folder, but create folder only if folder doesn't already exist? | Excel Programming | |||
Create Folder If It Doesn't Exist | Excel Programming | |||
How to: check if folder exist, if not, create | Excel Programming | |||
Test if folder exists, create if it doesn't? | Excel Programming | |||
Test if a folder exists, create if it doesn't? | Excel Programming |