I've got this function:
Function GetFullNameCSV() As String
GetFullNameCSV = Replace(ThisWorkbook.FullName, ".xlsm", ".txt")
End Function
If the code looked like this hard coded:
Filename:= "C:\directory\filename.txt"
I could just replace it with this and get the same result:
Filename:= GetFullNameCSV()
Problem is it appears in the case of this string:
Connection:= "TEXT;C:\directory\filename.txt"
I need to use string concatenation, guessing something like this:
Connection:= "\"TEXT;+GetFullNameCSV()+\""
What the code I need to use? Thanks.