Excel Automation with UiPath
Microsoft Excel: the unsurpassed champion in storing, organizing, and manipulating data, can now be more efficient than it already is. UiPath provides multiple ways of automating Excel using Excel Application Scope activities and Workbook activities.
Excel Application Scope activities and Workbook activities are pre-installed when you start a new project.
Excel Application Scope
This way you can automate Excel by having every activity in an Excel Application scope container. The activities can also be automated if Excel is not installed in the machine by disabling Visible checkbox. The primary required input parameter needed in Excel Application Scope is only the file path including the file name for which we are using this.
This app integration pack covers a lot and we can perform wide range of operations including reading a cell, writing in a cell, getting a color of a cell to create a pivot table, executing a macro, filtering a DataTable and many more.
Each Excel activity needs to be inside the Excel Application Scope container (except Close Workbook).
You can find extensive documentation for each activity in the UiPath App Integration support documentation.
Working with Add-ins
Loading an add-in with Excel Application Scope is a known issue right now and UiPath is trying to develop a solution for that. In the meantime, the alternate fix for using Excel add-in is to use Open Application/Start Process -> Verify using Element Exists if the Excel file has successfully opened -> Use Excel Application Scope after the file has successfully opened. This way, the add-in will also be successfully loaded and we will also be able to use Excel Activities.
The activities grouped under Workbook can be implemented even if Microsoft Excel is not installed in the machine. Workbook activities do not need any container. Although Workbook activities are limited compared to Excel Application Scope activities, we can perform a variety of basic Excel operations using Workbook activities.
An extensive documentation of these activities can be found in the Systems section of the UiPath Activities Guide support documentation.
Best Practices while using Excel Activities
1. Use "Kill Process" and kill any pending Excel activities that might not be closed completely.
2. Validate version of Excel in the Development environment is same in Production environment.
3. Use Dynamic Selectors while using Send Hotkey or Type Into or Click activity.
4. Use Type Into or Send Hotkey activity instead of clicking activities and selecting any function from ribbon menu. For example: Use Send Hotkey 'Alt +HW' to use 'Wrap Text' instead of using Click activity Click Home->Click Wrap Text.
5. Instead of filtering the data in Excel itself, read the data as DataTable and make the use of Filter Data Table to filter rows and columns.
.xls files cannot be worked with Excel activities.
To apply a formula in Excel you need to use an Excel application.
“Excel - Love it or hate it but you need it.”