I have a table that is linked to an external text file. I am able to select the open window so that each time the data is refreshed I may select a different file. I am also able to select to option that doesn't require the pop-up and open from the LAST opened path and file name.


Windows("stats.xls").Activate
Sheets("Data").Select
Range("B2").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

How can I set the code so that I can have the path / filename directly in my code instead. I want to be able to select a checkbox for file1 or file2 and the system will automatically open the selected file without the popup.

Is this possible?