top of page

Use VBScript actions to speed up Excel automations

💡 Sometimes, it can be tedious or difficult to create Microsoft Excel automations using Power Automate Desktop’s built-in actions or even macros. Using Copilot and the “Run VBScript” action, we can ease and speed up the process.

Problem Description


As an example, take the use case where an Excel sheet must be duplicated, renamed, and then filtered based on certain criteria.

  • Power Automate Desktop currently does not have built-in Excel actions for duplicating a sheet, hence developing the automation would be slightly complex and/or slower.

  • Using UI actions such as right clicking the sheet tab, clicking “Move and Copy”, checking “Create a Copy”, etc. can be unreliable and time consuming.

  • Using Excel actions to add a new worksheet and copy the data sometimes leads to data formatting issues.


What can we do?

Solution


One way to solve this problem is to leverage the new “Run VBScript” action together with the new Copilot feature. Conveniently, the citizen developer does not need to have extensive knowledge on how to write code in VBScript.


  1. We will add and use the action “Run VBScript” to the desktop flow. (Note that we do not need to have the “Launch Excel” before this, and the input Excel file should be closed.)



  2. We will click on “Generate script with Copilot”.



  3. We will then describe what we want our script to do, and then click on “Generate”. For example:



  4. After a few moments, the script will be ready. Click “Use this script”, and “Save”.




  5. Our script is now ready to be run.








Additional Information


  • Last updated on: 9 Dec 2024

  • Tested version(s): 11.2411.209.0

  • Prerequisites: Excel

  • Dependencies: None

  • Known issues:

    • Copilot is currently a “preview” feature. Sometimes, manual modification of generated code may be necessary.

Robotic Process Automation Singapore

CFB Bots is a leading technology service provider in the fast-growing field of Intelligent Automation. We partner with large enterprises in their Digital Transformation journey and help them and their employees thrive in the Future of Work.

NAVIGATE
CONTACT US
STAY CONNECTED

Singapore

CFB Bots Pte Ltd

Registration No.: 201705263H

77 High Street

#05-09, High Street Plaza

Singapore 179433

T: +65 6909 2099

E: enquiries@cfb-bots.com

Malaysia

CFB Bots Sdn Bhd

Registration No.: 202401045826 (1591672-X)

Suite: 33-01, 33rd Floor

Menara Keck Seng

203 Jalan Bukit Bintang

55100 Kuala Lumpur

T: +60 39 388 0352

E: my@cfb-bots.com

Australia

T: +61 2 8880 5998

E: au@cfb-bots.com

Join our mailing list to get the latest insights on automation

  • LinkedIn Social Icon
  • Facebook Social Icon
  • Twitter Social Icon
  • Instagram Social Icon
  • YouTube Social  Icon
TS Master Logo.png

© 2017-2025 CFB Bots Pte Ltd. All Rights Reserved. Tel: (65) 6909 2099 | Email: enquiries@cfb-bots.com | Privacy Policy | Terms of Use

bottom of page