问题
How to change Excel PowerQuery Paramaters with VBA?
i.e. These Paramaters:
Right now the Paramater has a value of 8, and is used in refreshing all other power queries. How can I change this paramater with VBA?
The Macro recorder does not show anything.
回答1:
Thanks to QHarr, I figured it out. Simply edit the Power Query M Code - the Parameter value is first item in the Code.
e.g.
5 meta [IsParameterQuery=true, Type="Number", IsParameterQueryRequired=true]
5 is the Parameter Value.
To edit, use the "Formula" Property e.g.
ThisWorkbook.Queries([ParameterName]).Formula = 'New code here
来源:https://stackoverflow.com/questions/52703993/how-to-change-excel-power-query-paramaters-with-vba