Share via

Power Query Recordset in VBA?

Patrick O'Beirne 26 Reputation points
2020-12-30T17:08:03.673+00:00

Is there a way to return an ADO.Recordset into Excel from a Workbook.QueryTable ?
I know how to create a ListObject with its Querytable, which necessarily means dumping all the data on to a worksheet. I'd like a Recordset in-memory.

Developer technologies | Visual Basic for Applications
Community Center | Not monitored

2 answers

Sort by: Most helpful
  1. P O'Beirne 1 Reputation point
    2021-02-14T14:52:14.407+00:00

    Thank you Inbar, that answers the question.

    I wonder, will we some day be able to connect to the Data Model in VBA?

    Was this answer helpful?

    0 comments No comments

  2. Inbar Privman 1 Reputation point
    2021-02-14T14:47:46.887+00:00

    Hi @Patrick O'Beirne , to quote one of our Excel specialists:
    A power query table is not a source that one can connect to, it is a transient entity that acts as an intermediary between a source and a query table in Excel or between a source and the Excel/Power Pivot data model.
    This means that there is no way to connect directly to a Power Query table, only to the persistent result of the query in a query table or in the model.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.