Consulting

Results 1 to 16 of 16

Thread: How to query an open ListObject?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    How to query an open ListObject?

    I want to pull data from a ListObject into VBA using SQL statements. I don't need to pivot. I don't need any front-end display or controls.

    My first thought was ADO, but a memory leak has been reported when querying an open workbook with ADO:




    What options are there to pull data from a ListObject in an open workbook into VBA?

    I'm looking at "Connections" and "Data Model". It seems that creating a "new Connection" is the simplest way to connect to a ListObject, correct? Can i execute a SQL statement against a Connection? Is it necessary to add the table to the Data Model?

    I think i don't need to use a Query object, because i think that's a front-end display component which sits on top of Connections, and therefor just adds more overhead, correct?

    I think i might make use of one of the Power addins, but prefer to use the core features without addins, if possible. Again, seems like unnecessary overhead.

    Is there a different/better/easier way?

    (Also asked here
    https://www.vbforums.com/showthread....ject&p=5538435
    https://www.excelforum.com/excel-pro...istobject.html)
    Last edited by johnywhy; 10-02-2021 at 02:21 PM.

Tags for this Thread

Posting Permissions

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