Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Protecting Excel WorkBook using Automation Anywhere

  • Last Updated : 13 Oct, 2020

Automation Anywhere can be considered as automation technology which reduces human efforts and gives error-free outcomes. It is purely based on cloud applications and provides high scalability.

Automation Anywhere Enterprise caters to organizations that are looking to deploy a digital workforce composed of software bots that complete business processes end-to-end. Automation Anywhere Enterprise combines traditional Robotic Process Automation (RPA) with cognitive elements such as Natural Language Processing and reading unstructured data.

Using Excel Commands In Automation Anywhere

A huge amount of data can be sorted, formatted, encrypted, modified using excel commands which increases in productivity. The ability to work with every cell and to perform the required changes can be done using Automation Anywhere.

In this article, we will be demonstrating how to protect an Excel workbook using Automation Anywhere.


  1. Keeping a session name & providing a path of our Excel file.
  2. Assigning passwords (for both author & reader).
  3. Adding a Message box (optional).
  4. Closing Excel file.

Step 1: Log in using your credentials to Automation Anywhere community edition using the Google Chrome browser.

Step 2: On the home page click on create a bot and in the pop-up name the bot as Protecting Excel Work book and click on Create & Edit. At this stage, we are ready to work on our bot, before we proceed with working on our bot, Create a .xlsx file (Excel file) on your desktop and save the file as gfgdoc.xlsx. Now return to the community edition page.

Step 3: Identify the labels Variables, Actions, Triggers, and click on Actions, notice that all the actions under this label are alphabetically ordered.

  • Find the Open option under Excel Advanced and drag it ensuring to place it exactly under Start in the flow. After performing this step successfully, the flow will be exactly like the picture below

Excel Advanced


  • Click on Excel advanced: Open in the flow and notice that a frame opens at the right side of the screen to edit it.

Excel advanced:open

  • For the first field Session name set the name as protecting-excel-workbook (remember the session name as it will be used later).
  • Under the File path, there are 3 fields Control Room File, Desktop File, Variable. The purpose of these three fields is to save an Excel file. Though the purpose of the three fields is the same they are utilized according to the purpose of the bot. As we are creating a simple bot to protect our Excel file using a password, we shall proceed with Desktop File. After clicking on Desktop File click on Browse and choose gfgdoc.xlsx (this file is created earlier).

Choose Desktop File


Step 4: Click on Actions and choose To Protect Workbook under Excel advanced and drag it so that it is placed under Excel advanced: Open.                      

Protect Workbook

  • Click on Excel advanced: Protect Workbook in the flow and edit the fields.

Excel advanced: Protect Workbook

  • Set the session name as protecting-excel-workbook (same name as in the previous step).

Set session name

  • Now there are two more fields, by checking the Protect workbook field we are protecting the workbook with a password.
  • By checking the Protect workbook structure field it allows us to protect the workbook with a password with few limitations in the workbook.
  • Check the box of Protect workbook, observe the fields credential, variable, Insecure string, here we have to add the variable of our password.
  • To create a variable to our password, click on the Variable field(on the left sidebar) and click on Create a variable (‘+’icon, see the below picture).

Create a variable

  • Now give the Name as password and default value as admin and click on Create (admin is the password to open file).

Set password

  • Now go back to the flow and insert a variable in the Protect Workbook field.

Insert variable in the Protect Workbook

  • From the drop-down menu select password-String and click on Yes, insert.

Select password-String

Step 5: Search for the Message box in the actions and drag it to place in the flow.

Search message box

  • Click on the Message box in the flow to edit, under Enter the message to display enter Workbook is successfully protected and click on Apply.

Enter the message

Step 6: From Actions, select Close under Excel advanced and drag the close option to the end of the flow.

Select close option

  • →Click on Excel advanced: Close and edit the session name as protecting-excel-workbook and click on Apply.

Excel advanced: close

  • Our bot is now ready to protect the Excel file, below picture is the entire flow of the bot


Entire flow of the procedure

Flow view of the bot

  • Now Save the bot and click on Run.

Click on Save and then run

  • It takes a few minutes to run the bot. After protecting the file we see the message box as-

Message after protecting the excel file

  • Click on close. The bot is successfully running now.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!