Applying formatting and styles of cells in our Excel workbooks is important to maintain a clean and clear format. In this article, you will learn how to format cells in an Excel file.
Here’s how to do it in a few easy steps:
Create the VBS script with the instructions needed
Save the VBS file in the root folder of the project
Use Execute Macro activity and set the parameters
3.1. Set the Excel file path using the picker button or using the Calculate a value option following the JS methods for handling strings
3.2. Set the VBS script path using the picker button or using the Calculate a value option following the JS methods for handling strings
3.3. Enter the name of the function without the parentheses. For example, if a
Sub Testing() function is created, just enter Testing
3.4 Run the workflow.
The expected result is saved within the Excel file. To validate it, it is necessary to open the file.
For example, to change the background color of a cell or group of cells, use the "ColorIndex" property. To do so, declare the color-index in a variable and then pass it using the "Input arguments" field of the Execute Macro activity.
For a Project Example, check out the attached file.