如何使用 VBA 更改 Excel Power Query 参数 [英] How to Change Excel Power Query Paramaters with VBA

查看:97
本文介绍了如何使用 VBA 更改 Excel Power Query 参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 VBA 更改 Excel PowerQuery 参数?

How to change Excel PowerQuery Paramaters with VBA?

即这些参数:

现在 Paramater 的值为 8,用于刷新所有其他电源查询.如何使用 VBA 更改此参数?

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.

推荐答案

感谢 QHarr,我想通了.只需编辑 Power Query M 代码 - 参数值是代码中的第一项.

Thanks to QHarr, I figured it out. Simply edit the Power Query M Code - the Parameter value is first item in the Code.

例如

5 meta [IsParameterQuery=true, Type="Number", IsParameterQueryRequired=true]

5 是参数值.

要编辑,请使用公式"属性,例如

To edit, use the "Formula" Property e.g.

ThisWorkbook.Queries([ParameterName]).Formula = 'New code here

这篇关于如何使用 VBA 更改 Excel Power Query 参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆