+ Reply to Thread
Results 1 to 5 of 5

Running an SQL query on the open workbook

  1. #1
    Registered User
    Join Date
    06-15-2010
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    3

    Running an SQL query on the open workbook

    How do I run an SQL query on the current open workbook? I know it's possible to save it into a file first and than open a connection to that file, but if possible I want to access the data on my sheets with SQL without saving them first.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Running an SQL query on the open workbook

    Your workbook has to have been saved at some point or you can't connect to it. You should also be aware that there are memory leak issues if you use ADO to run SQL on the current workbook.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    06-15-2010
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Running an SQL query on the open workbook

    That sucks. What can I use beside ADO?

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: Running an SQL query on the open workbook

    You can use DAO but you still have to have saved the workbook. (I don't know if the same memory leaks occur with DAO to be honest, since I don't use it with Excel.)

  5. #5
    Registered User
    Join Date
    06-15-2010
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Running an SQL query on the open workbook

    OK, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1