activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

生产力活动

上次更新日期 2026年3月20日

执行宏

UiPath.Excel.Activities.ExecuteMacro

在工作簿中执行宏。工作簿文件必须是启用宏的工作簿。所做更改会立即保存。只能在“ Excel 应用程序作用域”或“使用 Excel 文件”活动中使用。

属性

输入
  • “宏名称”- 要执行的宏的名称。仅支持字符串和字符串变量。
备注:

必须为字符串加上引号。

  • “宏参数”- 用于在执行宏时传递参数。该字段仅支持“IEnumerable<Object>”变量。
常见
  • “显示名称”- 活动的显示名称。
  • ContinueOnError - Specifies if the automation should continue even when the activity throws an error. This field only supports Boolean values (True, False). The default value is False. As a result, if the field is blank and an error is thrown, the execution of the project stops. If the value is set to True, the execution of the project continues regardless of any error.
备注:

如果“Try Catch 异常处理”中包含该活动且“出错时继续”属性的值为“True”,则系统在执行项目时不会捕获任何错误。

其他
  • “私有”- 选中后将不再以“Verbose”级别记录变量和参数的值。
输出
  • “宏输出”- 宏执行所返回的值(如有)。活动会以“对象”变量形式检索此输出。

“执行宏”活动使用示例

为举例说明该活动的具体用法,我们构建了一个自动化项目,用于初始化宏、询问用户宏名称并执行宏。
 
 
下载示例

  • 属性
  • “执行宏”活动使用示例

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新