Changed the scope
New Scope
Upgrade existing code to check and see if directory exist
If it does continue
If it does not pop up a message asking if user wants it created
if no end routine, if yes continue.
here is existing code
Sub Open_File()
Dim strFile As String
Dim strFilePath As String
Dim i As Integer
strFile = "MyFile Name"
strFilePath = "C:\Reports"
strFileName = Format(Now, "mm-dd-yyyy") & strFile
outputFile = FreeFile
Open strFilePath & "\" & strFileName & ".txt" For Output As outputFile
For i = 1 To 20
Write #outputFile, "test line"
Next
Close outputFile
Exit Sub
E_Handler:
MsgBox "Error " + CStr([login to view URL]) + "!: " + [login to view URL]
End Sub