J
Joe
I have code that creates a bunch of csv files from the
data in a workbook. Here are a couple of excerpts from
my code:
fldr = InputBox("Enter Directory Name", "CSV FILE
LOCATION")
..
..
..
Set fs = CreateObject("Scripting.FileSystemObject")
If Not fs.FolderExists(fldr) Then
fs.CreateFolder fldr
End If
If the user enters c:\joe\ and c:\joe\ doesn't exist,
then the code will create a folder called c:\joe\.
If the user enters c:\joe\bob\ and c:\joe\bob\ doesn't
exist, then the code will create a folder called
c:\joe\bob\ BUT ONLY if c:\joe\ exists. If c:\joe\
doesn't exist, I get a run-time error. Is there a
solution to the problem? I don't want my macro to
terminate if the folder doesn't exist.
data in a workbook. Here are a couple of excerpts from
my code:
fldr = InputBox("Enter Directory Name", "CSV FILE
LOCATION")
..
..
..
Set fs = CreateObject("Scripting.FileSystemObject")
If Not fs.FolderExists(fldr) Then
fs.CreateFolder fldr
End If
If the user enters c:\joe\ and c:\joe\ doesn't exist,
then the code will create a folder called c:\joe\.
If the user enters c:\joe\bob\ and c:\joe\bob\ doesn't
exist, then the code will create a folder called
c:\joe\bob\ BUT ONLY if c:\joe\ exists. If c:\joe\
doesn't exist, I get a run-time error. Is there a
solution to the problem? I don't want my macro to
terminate if the folder doesn't exist.