I don’t know how useful this will be, but thought I’d post it anyway as I haven’t seen it mentioned anywhere before.
If you are using MSQuery to retrieve data from an Excel workbook (or using the Import Data function rather than the New Database Query function), then any named ranges that have been defined dynamically will not appear as tables. For example, you have defined the name Export
as:
=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),COUNTA(Sheet1!$1:$1))
Export will not appear as a table in the dialog. (The same seems to be true trying to use VBA/ADO to retrieve this based on my quick tests).
However, if you define an additional name, let’s say Export2
, as:
=EVALUATE(Export)
then this does appear in the MSQuery dialog and in the Import Data dialog as a valid table.
Any thoughts/comments/problems appreciated. Note: I have only tested this in Excel 2002, but have seen it mentioned as an issue in prior versions – I do not know if it was fixed in subsequent versions.