Forum Discussion
Manage Excel Power Query Groups when importing queries with a script.
Is there a way I can programatically manage which groups that queries reside under? I can't find any reference in Excel VBA to the Power Query Object Model.
Inspired by EditExcelPQM, I wrote VBA scripts inside my spreadsheets to import and export Queries, so I can do all my editing and source control in VSCode. When I import new scripts or reimport existing scripts, they all land in the "Other Queries" folder.
(Aside from when doing deep debugging with the full scripts, my queries in Power Query simply load the .pq script files and add them as functions using Expression.Evaluate. That way all source code is external to the Excel file, and only functions I have explicitly invoked will return data to excel. This seems to speed excel up immensely, as Excel isn't constantly refreshing intermediate queries.)
1 Reply
- AnonymousNot applicable
Hi scottdk ,
Thank you for sharing your findings and tips.
I have attempted to identify a solution for managing query grouping from the VBA documentation and some of the standard tripartite tools, but have been unable to find a suitable solution. It is possible that no such interface is provided.Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group