Hey guys,
Do you know of any codes that automatically creates a file? Whenever I use open/get etc, I need to manually create the file, or otherwise I get a bad file name error.
Thanks in advance
breezyy
Recommended Answers
Jump to PostTry this code
Dim Fso As New FileSystemObject Dim Fl As TextStream Dim fName as String fName = App.Path & "\" & "MyFile.txt" If Dir(fName) <> "" Then If MsgBox("File Exists.OverWrite?",vbYesNo,"FILE EXISTS")=vbYes Then Set Fl = Fso.CreateTextFile(fName, True) Else GoTo ExitPoint End If Else 'Here True/False is …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.