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

生产力活动

上次更新日期 2025年11月11日

关于 Excel 活动包

The UiPath.Excel.Activities package helps automate all aspects of Microsoft Excel, which is one of the most commonly used tools across industries. It contains activities that allow you to read information from a cell, columns, rows, or ranges, write to other spreadsheets or workbooks, execute macros, and even extract formulas. Moreover, you can sort data, color-code it, or append additional information.

重要提示:从 3.0.0 版本开始,我们不再支持旧版项目中的传统活动。您仍然可以在 3.0.0 之前的版本中使用传统活动。有关更多详细信息,请查看即将移除的页面。

兼容性

注意: UiPath.Excel.Activities包与以下Microsoft Excel版本兼容:
  • 2013
  • 2016 年
  • 2019 年
  • 2021 年
  • 2024
  • Office 365
  • Office 2024

配置

You can enable the modern experience as explained in Project Settings.

新式活动

新式 下分组的活动是最初为 StudioX 配置文件设计的最新活动。

The Excel Modern design experience and activities provide the same functionality of the StudioX business activities by default in Studio. Follow the tutorial section to find out more about working with Excel activities in Studio. For a full guide, check the Excel Automation in the StudioX guide.

Studio Modern design experience

A modern design experience is available in the Studio profile starting with Studio v2021.10 and UiPath.Excel.Activities v2.11.0. In the modern experience, the modern activities replace the classic activities in the Studio profile, and the StudioX design experience is brought to Studio.

The modern design experience is enabled by default. You can select the design experience for each project from the Excel activities project settings. When the classic experience is enabled for a project, the classic app integration activities that do not support interacting with Excel from the plus menu are available in the Activities panel in Studio instead of the modern activities.

教程

Add the Use Excel File scope activity to indicate the file to automate and configure its child activities by selecting Excel data from the plus menu of each property without having to manually enter expressions:

  1. Use the folder icon to browse the contents of the file and select data that matches the type of each property. For example, you can select cells, ranges, tables, sheets, or charts from the worksheet. You can also indicate the current row or current sheet in an iteration.

  2. If you find it easier to work in Excel, in the In range field, select the plus menu for more options, then select Excel, and then Indicate in Excel to select data directly from the file.
    Note: This functionality requires that you install the Excel Add-in.


  3. 使用“ 自定义输入 ” 选项可以根据表格、图表或工作表名称手动指定输入,或者输入对单元格或范围的引用。


If the file you want to automate does not exist yet, you can still use the options in the plus menu by defining a file with the same structure as a template in the Use Excel File activity.

Choosing the most suitable activity type

To decide which type of activity you should use, check the following table.

Note: Modern activities include a wider range of options than classic ones.
活动类型项目兼容性Excel installation required性能用户体验Best used when
Use Excel File (Modern) Windows, Cross-platformHigh (memory optimized)Visual and guided (Plus menu, Indicate in Excel)Building modern workflows, working across profiles.
Excel Application Scope (Classic) Windows, Windows-legacyBest for large or complex user interface tasks.Manual setup requiredAutomating legacy Excel user interface workflows. Classic Excel activities are not suitable for new automations. It is recommended to use modern activities instead.
Workbook 活动Windows, Cross-platform, Windows-legacyGood for lightweight headless operations.Simple expression-basedExcel is not installed, or the user interface is not required.

Workbook 活动

Workbook activities can be executed even if Microsoft Excel is not installed on the machine and can only read or write data to and from the file.

您可以通过以下两种方式之一指定要在活动中处理的文件:
  • 提供每个 Workbook 活动中的文件路径。使用此选项时,系统会在 Runtime 为处理该文件的每个活动将其加载到内存中。此选项最适合较小的文件。
  • Connect your Studio project to the Excel file from the Data Manager to add it as a resource, then reference the resource in each Workbook activity by selecting it from the plus menu. Using this option, once the file is loaded, it remains in the memory until all the activities in the defined scope are executed, providing the best runtime performance when working with larger files and a larger number activities. To optimize performance, set the scope to the container closest to where the activities that use the resource are placed in the workflow. For more information, check Using the Data Manager.


应用程序集成活动

传统应用程序集成活动 需要在运行它们的计算机上安装 Excel 应用程序。 对于跨越大量行和列的大型复杂电子表格,我们建议使用 应用程序集成 活动,因为这些活动可提供最佳性能和一致性。

除 CSV 活动外,所有应用程序集成活动必须包含在 Excel 应用程序作用域中 才能正常工作。 从 Excel 活动包 2.10.4 版开始,这些活动也可以包含在“ 使用 Excel 文件 ”活动中。

专用活动支持使用 .csv 文件,而其余所有活动则适用于 .xlsx.xls 文件。仅适用于 Excel 应用程序作用域的活动同样支持使用 .xlsm 文件。

故障排除和限制

Note: The Excel Activities Pack does not support the old Excel Binary File Format (.XLS) specific to Microsoft Excel 95.
  • When you use activities that read, copy, or append ranges, if a cell contains formatting information, Excel considers that cell as containing data, even though it appears empty.
  • The Microsoft Office 2016 version 1708 (Build 8431.2079) changes the window title of files that are being edited and saved from "FileName.xlsx - Excel" to "FileName.xlsx - Saved". After closing the file, the filename reverts to normal.

    如果自动化项目使用包含窗口标题的选取器,则可能会导致一些问题。例如,如果您的 Excel 版本为前述版本,则以下选取器不再可用:<wnd app='excel.exe' cls='XLMAIN' title='FileName.xlsx - Excel' /> <wnd cls='EXCEL7' title='FileName.xlsx' />。为防止出现此问题,建议您使用动态变量选取器。
  • Some Excel versions, for example, Excel 2019, always open SharePoint documents in read-only mode. You can check if a remote document supports editing by opening it manually in Excel on your local machine.

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。