Woman works on a Windows laptop in a work environment.

Run your Office Scripts using a button in Excel for Windows

Feature deep dive
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

Hey, Insider community! I’m Nancy Wang, a Program Manager on the Office Scripts team. Up until now, Office Scripts could only be used in Excel for the web—I’m excited to announce that you can now run your scripts in Excel for Windows with the simple click of a (script) button! 

Run Office Scripts using a button

We heard you! Your feedback helped us make the decision to bring script buttons to Windows. Since releasing Office Scripts, we have heard you’d like a way to share scripts with colleagues, as well as the ability to use scripts in Excel for Windows.

With script buttons becoming available in Excel for Windows, we move one step closer to making Office Scripts an automation solution that you can use to manage your workflow anytime and anywhere. While you still need to use Excel for the web to create and manage your scripts, we recognize that Excel users utilize a variety of platforms to complete their tasks. So we intend to investigate more cross-platform investments as part of our future work.

How it works

To create a script button in your workbook: 

  1. In Excel for the web, open a workbook to which you want to add a script button.
  2. On the Automate tab, select a script. NOTE: if you don’t have an existing script available, you can select the More Scripts button and make a copy of one of the sample scripts.
  3. In the Code Editor pane, select the More options (…) button, and then click Add button

Code Editor pane

  1. To move or customize the script button that appears, right-click it or select the Shape tab, and then make the changes you want.

To run a script button in your workbook: 

  1. In Excel for Windows, open the file that contains the button you added using Excel for the web. 
  2. Select the script button to run the automated actions. 

Tips and tricks

To view a script assigned to a button, right-click the button and select View script.

Known issues

Right-clicking a button and selecting View script may open two panes—one containing the script’s details (as expected), and another that appears to be loading something. You can safely ignore or close the second pane.

Requirements

In order to use this feature, you must:

  • Have a commercial license for Microsoft 365.
  • Install and run webview2. Learn more

Availability

The feature is rolling out to Office Insiders running Beta Channel Version 2202 (Build 14922.20000) or later.

Don’t have it yet? It’s probably us, not you.

Features are released over some time to ensure things are working smoothly. We highlight features that you may not have because they’re slowly releasing to larger numbers of Insiders. Sometimes we remove elements to further improve them based on your feedback. Though this is rare, we also reserve the option to pull a feature entirely out of the product, even if you, as an Insider, have had the opportunity to try it.

Feedback

If you have any feedback or additional suggestions for improvements, please select Help > Feedback in Excel for Windows to let us know.

Learn what other information you should include in your feedback to ensure it’s actionable and reaches the right people. We’re excited to hear from you!

Sign up for the Office Insider newsletter and get the latest information about Insider features in your inbox once a month!