Documentation on valid Power Query Querytable connection strings?

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

I see that the syntax for a connection string is

worksheet.ListObjects.Add(SourceType:=0, Source:= _
"OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=(the query name)"

Is there any documentation for what is a valid connection string? eg What other values can there be for Data Source?

Also, is there any other connection possible to a PQ WorkbookQuery than a ListObject?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
40,173 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Inbar Privman 1 Reputation point
    2021-02-14T08:18:09.043+00:00

    We recommend not to play with the settings but to rely on Excel to create the connection string and command text. Changing the settings can cause the workbook to be corrupted.
    If you want to explore it further, you can create a few sample queries, but there is no documentation for it.

    Inbar Privman
    Microsoft Team

    0 comments No comments

  2. P O'Beirne 1 Reputation point
    2021-02-14T14:27:48.55+00:00

    OK Inbar, thanks for clarifying that there is no documentation.

    I asked another question, and the only reply I have so far is a precision that it relates to connection strings and Data Source.
    If you know about connection strings, maybe you or someone else could answer it or suggest a more appropriate forum on which I could ask it?

    https://learn.microsoft.com/en-us/answers/questions/214520/power-query-recordset-in-vba.html

    For your convenience I copy the question here:
    "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."

    0 comments No comments

Your answer

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