Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my macro I need to check to see if a folder exists b/4 I create one. What
command should I use? Does anyone have some quick code to check if a folder exists and if not, create it? Dan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dan,
Ron posted this on the 17th... 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 -- sb "Dan" wrote in message ... In my macro I need to check to see if a folder exists b/4 I create one. What command should I use? Does anyone have some quick code to check if a folder exists and if not, create it? Dan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On error resume next
mkdir "C:\test" on error goto 0 (just ignore the error if it's already there.) Dan wrote: In my macro I need to check to see if a folder exists b/4 I create one. What command should I use? Does anyone have some quick code to check if a folder exists and if not, create it? Dan -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking to see if a file exists. | Excel Discussion (Misc queries) | |||
Checking if Sheet Exists? | Excel Discussion (Misc queries) | |||
Checking to see that a CHART exists prior to running a simple command | Excel Discussion (Misc queries) | |||
How to check if a file exists in an ftp folder | Excel Discussion (Misc queries) | |||
Checking 2 c if workbook exists | Excel Programming |