title: ADO: Excel: Is it possible to open recordset on table name?
body: <p>I have looked on the web but did not find any answer. So i am putting it here.</p>
  
  <p>Code snippet: ( where case 1 is not working.. )</p>
  
  <pre><code>_bstr_t    strCnn(L"Provider='Microsoft.ACE.OLEDB.12.0';DataSource=C:\\Book.xlsx;Extended Properties=\"Excel 12.0 Xml; HDR = YES\"");
  
  hr = pConn-&gt;Open(strCnn, "", "", adConnectUnspecified); // success
  
  **LPCSTR strQuery = "select * FROM Table1";          // case1: Not working**
  
  LPCSTR strQuery = "select * FROM [Sheet1$]";       // case2: working
  
  LPCSTR strQuery = "select * FROM [Sheet1$A1:D10]"; // case3: working
  
  hr = pRst-&gt;Open(CComVariant(strQuery), _variant_t((IDispatch *)pConn, true),
                  adOpenStatic, adLockOptimistic,adCmdText); // fails for case 1
  </code></pre>
  
  <p>Is this possible in excel? or there is something wrong in the above code.</p>
  
  <p>NOTE: I have tried this with Microsoft Access and binding recorset to table name works fine there.</p>