activities
latest
false
Productivity Activities
Last updated Aug 14, 2024

Excel APIs

APIs allow you to access and interact with the services offered in the Manage Packages menu. You can use these APIs when you design coded automations. Visit Coded Automations to learn about coded automations and how to design them using APIs.
Note: Using Go to Definition (F12) allows you to access the definition of UiPath APIs for a certain service. We recommend relying only on the directly exposed APIs when you implement coded automations. Other APIs that are not directly exposed with a service are subject to change without prior notification.

Overloads

APIs often have overloads, which means they provide multiple versions of the same method with different parameter options. Overloads allow you to customize the behavior of the API based on your specific requirements. For example, a UI Automation API may have an overload that accepts a timeout parameter to specify the maximum time to wait for a UI element to appear before ending execution.

By using the APIs with their respective overloads, you can easily achieve your desired automation logic and behavior.

Using APIs

To use the Excel APIs, apply the following steps:
  1. Download the activity package.
  2. Create a Coded Workflow.
  3. Call the excel.UseExcelFile method to retrieve the handle of an Excel file.
    Note: By default, the excel.UseExcelFile method uses the Excel options from Project settings for the resulting handle. However, you can change the behavior by overriding the default options through the excel.ExcelProcessScope method.
  4. Use the handle to perform actions. With the Excel coded automation, you should be able to perform the same operations as with the Excel modern activities in a .xaml file.
    Note: The IExcelProcess handle that is returned can be used with UseExcelFile to better control the Excel application. For example, you can control how Excel is opened or closed on exit.
  5. For Workbook activities, use the excel.UseWorkBook method to retrieve the handle of an Excel file. The available activities are also implemented as extension methods on the ExcelOperations class.
Note: The Excel activities are implemented in the Coded service as extension methods for handles. To check all the available extension methods, type ExcelOperations. and then Ctrl + Space.

Examples

  • UseExcelFile_1.Simple.cs - check all the available extension methods for handles.
  • UseExcelFile_2MoreOptions.cs, UseExcelFile_3AllOptions.cs - use the IExcelProcess handle to better control the Excel application.
  • UseWorkbook_4.cs - retrieve an Excel Workbook handle.
  • UseExcelFile_Filter.cs - how to filter Excel.
  • UseExcelFile_PivotTable.cs - how to create and filter a pivot table.
  • UseExcelFile-ExecuteMacro.cs - how to execute a macro.

The mentioned examples can be found in the GitHub location.

  • Overloads
  • Using APIs
  • Examples

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.