How do I read an Excel Named Table? RRS feed

  • Question

  • First I am using Excel 2007 and a .xlsm file. I am able to read in data from Excel that is on a Sheet or in a Range, but how do I read from a named table. 

    My sampe file as data in B10:G20 and that area is a table named Table1.  Since the location and size changed between my actual files, Table1 will not always be in that location.

    Here is the SQL command I am currently using

    SELECT * FROM OPENROWSET ('Microsoft.ACE.OLEDB.12.0','Excel 12.0; Database=C:\Test.xlsm', 'SELECT * FROM [table1$]') 

    I have also set this file up as a Linked Server and have gotten the same result.  And I have tried Table1 with and without out square brackets, and with and without the dollar sign.  I'm sure I'm missing something small.


    Thanks for any help you can give!.

    Wednesday, May 18, 2011 8:57 PM


All replies