Using a path and file name through varible in selection query table

With Selection.QueryTable
        .Connection = "TEXT;E:\Archive\Delivery\" & sfnametxt

now i want to use a variable that consists the entire file path and name instead of hardcoding it. What is the exact syntax
RamanaVAsked:
Who is Participating?
 
abelConnect With a Mentor Commented:
You can do something like the following:

Dim sPath As String = "E:\Archive\Delivery\"
With Selection.QueryTable
        .Connection = "TEXT;" & sPath & sfnametxt

Open in new window

0
 
RamanaVAuthor Commented:
Thanks Abel for your quick response. it resolved my problem. Thanks once again and have a good weekend
0
 
abelCommented:
glad it worked for you :)
0
All Courses

From novice to tech pro — start learning today.