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
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

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

From novice to tech pro — start learning today.