ANDYB0ARDMAN
New Member
- Joined
- Jun 23, 2019
- Messages
- 5
All - good evening
Having some issues getting vba to work that specifically points two different data query table connections in one file to a specific separate source file.
The specific source file is located in c:\Crop Chemical Database\Crop Chemical Database.xlsm
I want the receiving (destination) spreadsheet to update two tables on open - one in a worksheet tab called "Table-Data" and one in tab called "Table-Setup". I have set up an auto_open command but as the destination sheet can be saved by others in various locations I need to be really specific about the source file location in the vba so no matter where they save the destination file the vba makes the connections look for the source file.
The two querys are named "Data 13" in Table-Data tab and "Setup" in Table-Setup tab
I have tried this for first table
With Worksheets("Table-Data").QueryTables(1)
.Connection = "XML;C:\Crop Chemical Database\Crop Chemical Database.xlsm"
.refresh BackgroundQuery:=False
End With
Not working for me....
Need to get this working so would appreciate any help you can provide.
thanks.............Andy
Having some issues getting vba to work that specifically points two different data query table connections in one file to a specific separate source file.
The specific source file is located in c:\Crop Chemical Database\Crop Chemical Database.xlsm
I want the receiving (destination) spreadsheet to update two tables on open - one in a worksheet tab called "Table-Data" and one in tab called "Table-Setup". I have set up an auto_open command but as the destination sheet can be saved by others in various locations I need to be really specific about the source file location in the vba so no matter where they save the destination file the vba makes the connections look for the source file.
The two querys are named "Data 13" in Table-Data tab and "Setup" in Table-Setup tab
I have tried this for first table
With Worksheets("Table-Data").QueryTables(1)
.Connection = "XML;C:\Crop Chemical Database\Crop Chemical Database.xlsm"
.refresh BackgroundQuery:=False
End With
Not working for me....
Need to get this working so would appreciate any help you can provide.
thanks.............Andy