collin8579
New Member
- Joined
- Oct 31, 2017
- Messages
- 20
Good morning,
I have queries that reference excel files on a network path,
In the attached picture my source is something like K:\ATT Cognos\STX Pace Data.xlsx
I need to be able to change it to different markets and refresh the query without having to go into the query manually,
I am looking for VBA solution, and have tried things like
With ActiveSheet.QueryTables.Add(Connection:=FilePath, Destination:=Range("$A$1"))
Worksheets(1).QueryTables(1) _ Connection := "TEXT;C:\My Documents\19980331.txt"
I haven't been able to figure out a solution that works and any help would be appreciated.
I have queries that reference excel files on a network path,
In the attached picture my source is something like K:\ATT Cognos\STX Pace Data.xlsx
I need to be able to change it to different markets and refresh the query without having to go into the query manually,
I am looking for VBA solution, and have tried things like
With ActiveSheet.QueryTables.Add(Connection:=FilePath, Destination:=Range("$A$1"))
Worksheets(1).QueryTables(1) _ Connection := "TEXT;C:\My Documents\19980331.txt"
I haven't been able to figure out a solution that works and any help would be appreciated.