Thank you for the great question. I want to clarify and second the solution posted by Philipp. The solution does the following:
- Updates data from a closed Excel file, and
- Does so "dynamically" (though not exactly - you'll see)
In his answer above, Philipp said: "The problem is that a link to a closed file works with index( but not with index(indirect("
I believe this is still true. (I'm using Office 365 here in March of 2021. It would be so nice if Microsoft allowed INDIRECT and INDEX to play nicely together with closed files!)
I can confirm that Philipp's workaround indeed works, practically speaking. From the user's point of view, it feels like what Chris, the OP, wants to do.
Let's say you want the contents of a given cell to be drawn from Sheet1, Sheet2 or Sheet3, which are from a closed file myExcelFile.xlsm. You will choose which sheet by changing the contents of a particular cell (C13, as in the OP Chris's question). One way to do this is to make it a drop-down list (using Data > Data Validation > Allow [List]). The list will have the following names:
Sheet1
Sheet2
Sheet3
(This will generalize without the drop-down list. For example, you can just type "Sheet2" into C13, and the relevant data from the closed file will appear; if you then type "Sheet3" then the data from that sheet will appear instead. Or you can have a column with the sheet names, and the next column over [with the formula below, adjusted] for the output from the closed file.)
The cell that will contain the referenced data from the other, closed sheet (myExcelFile.xlsm) will have:
=IFS(
C13="Sheet1",'C:\data\[myExcelFile.xlsm]Sheet1'!$A$1,
C13="Sheet2",'C:\data\[myExcelFile.xlsm]Sheet2'!$A$1,
C13="Sheet3",'C:\data\[myExcelFile.xlsm]Sheet3'!$A$1
)
And that's it.
It'll throw up a #REF error the first time you do this with myExcelFile.xlsm closed, but you can go to Data > Queries & Connections > Edit Links > Update Values and your values from the closed file should appear. (Personally, I set up a macro with a button to do the updating, instead of hunting through the menus.) The magic is that when you do Update Values, the data from all of the sheets in the closed file get loaded into the current Excel file - so you don't have to update every time you switch the reference to a different sheet (Sheet2 to Sheet3, for example).
Andrew