I have a query (Query1) loaded into Excel by using a connection from Teradata. Normally when I want to update the query, I have to right click it and choose edit.
Once inside the Power Query Editor, I can open the Source and edit the SQL script inside to update the query.
The question is how can I edit this SQL script using VBA?
Upon trying to use the Macro Recorder, I can only refresh the query using
ActiveWorkbook.Connections("Query - Query1").OLEDBConnection.Refresh
An attempt to edit the CommandText also failed. Here is the properties of the query.