I am trying to create macro that can create text file with variable and location of file is where user can choose the path.
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set app = CreateObject("Shell.Application")
Set D = app.BrowseForFolder(0, "Select Folder", 1)
If D Is Nothing Then
Inp = "C:\"
Else
Inp = D.Self.Path
End If
Set oTF = oFSO.CreateTextFile(oFSO.BuildPath("" & Inp & "\" & partdatetime & ".txt", wr, True))
i am getting error in last line. here "Inp" is stored path of text where it has to save (user selection). "partdatetime" is file name (name through variable). ca anyone tell me where i missed.
There are a number of errors in your last line of code.
Probably you mean to write