Hello everyone
I am trying to read data from a closed workbook. I would like to use dynamic range names. I define these with the name manager.
My problem is as follows:
If I set the name to fixed =Sheet1!$A$1:$A$3, then access to the datarange works perfectly.
However, if I create the name dynamically =OFFSET(ShLookup!$B$1,0,0,COUNTA(shLookup!$B:$B),1), I get the error message that the object “Range name” cannot be found.
My select looks like this
' SQL query to retrieve the named range
strSQL = “select * from [” & NamedRange & “]”
Does anyone have any ideas on how I can make the access so that the dynamically named range is used?
Translated with DeepL.com (free version)
I am trying to read data from a closed workbook. I would like to use dynamic range names. I define these with the name manager.
My problem is as follows:
If I set the name to fixed =Sheet1!$A$1:$A$3, then access to the datarange works perfectly.
However, if I create the name dynamically =OFFSET(ShLookup!$B$1,0,0,COUNTA(shLookup!$B:$B),1), I get the error message that the object “Range name” cannot be found.
My select looks like this
' SQL query to retrieve the named range
strSQL = “select * from [” & NamedRange & “]”
Does anyone have any ideas on how I can make the access so that the dynamically named range is used?
Translated with DeepL.com (free version)