title: Unable to query dynamically named range on Excel sheet using ADO
body: <p>Suppose I have an Excel Sheet named <code>Adjustments</code> stored in a variable called <code>wksName</code> and, on that sheet, I have a named range defined as follows if you look in the Name Manager:</p>
  
  <pre><code>tblData =OFFSET(Adjustments!$A$1,0,0,COUNTA(Adjustments!$A:$A),4)
  </code></pre>
  
  <p>So that it expands to as many rows as we have data in columns A thru D.</p>
  
  <p>Now I have the following code in my VBA module:</p>
  
  <pre><code>Set ExcelCon = CreateObject("ADODB.Connection")
  Set ExcelRecSet = CreateObject("ADODB.Recordset")
  
  ExcelCon.ConnectionString = "Provider='Microsoft.Jet.OLEDB.4.0';" &amp; _
                              "Data Source='" &amp; ThisWorkbook.FullName &amp; "';" &amp; _
                              "Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'"
  
  'Get the data for the update:
  ExcelCon.Open
  
  ' Get the data from the spreadhseet for the update statement
  Set ExcelRecSet = ExcelCon.Execute("SELECT * FROM [" &amp; wksName &amp; "$tblData]")
  </code></pre>
  
  <p>When I try and run this code, I get the error:</p>
  
  <pre><code>Run-time error '-2147217865 (80040e37)':
  The Microsoft Jet database engine could not find the object 'Sheet1$tblData'.
  Make sure the object exists and that you spell its name and the path name correctly.
  </code></pre>
  
  <p>Is this a limitation to using ADO - Named ranges can not be dynamically defined - Or is there a way I can get this to work?</p>
  
  <p>Thanks!!</p>