Manage Office Scripts settings

Office Scripts allows users to automate tasks by recording, editing, and running scripts in Excel. Office Scripts works with Power Automate, and users run scripts on workbooks by using the Excel Online (Business) connector. Microsoft 365 admins can manage Office Scripts settings from the Microsoft 365 admin center.

Note

To manage Office Scripts settings, you must be a Global admin. For more information, see About admin roles.

Manage availability of Office Scripts and sharing of scripts

  1. In the Microsoft 365 admin center, go to the Settings > Org settings > Services tab.

  2. Select Office Scripts.

  3. Office Scripts is turned on by default, and everyone in your organization can access and use the feature and share scripts. To turn off Office Scripts for your organization, clear the Let users automate their tasks in Excel check box.

  4. If you previously turned off Office Scripts for your organization and you want to turn it back on, select Let users automate their tasks in Excel, and then specify who can access and use the feature:

    • To allow all users in your organization to access and use Office Scripts, leave Everyone (the default) selected.

    • To allow only members of a specific group to access and use Office Scripts, select Specific group, and then enter the name or email alias of the group to add it to the allow list. You may add only one group to the allowlist, and it must be one of the following types:

      • Microsoft 365 group
      • Distribution group
      • Security group
      • Mail-enabled security group

      To learn more about the different types of groups, see Compare groups.

  5. To allow users with access to Office Scripts to share their scripts with others in your organization, select Let users with access to Office Scripts share their scripts with others in the organization. Sharing scripts outside of an organization isn't allowed.

    Note

    If you later turn off script sharing for your organization, users will still be able to run previously-shared scripts.

  6. Specify which users with access to Office Scripts can share their scripts:

    • To allow all users with access to Office Scripts to share their scripts, leave Everyone (the default) selected.

    • To allow only members of a specific group with access to Office Scripts to share their scripts, select Specific group, and then enter the name or email alias of the group to add it to the allow list. You may add only one group to the allowlist, and it must be one of the following types:

      • Microsoft 365 group
      • Distribution group
      • Security group
      • Mail-enabled security group

      To learn more about the different types of groups, see Compare groups.

  7. To allow users to run their Office Scripts inside Power Automate flows, select Let users with access to Office Scripts run their scripts with Power Automate. This allows users to add flow steps with the Excel Online (Business) Connector's Run script option.

    • To allow all users with access to Office Scripts to use their scripts in flows, leave Everyone (the default) selected.

    • To allow only members of a specific group with access to Office Scripts to use their scripts in flows, select Specific group, and then enter the name or email alias of the group to add it to the allow list. You may add only one group to the allowlist, and it must be one of the following types:

      • Microsoft 365 group
      • Distribution group
      • Security group
      • Mail-enabled security group

      To learn more about the different types of groups, see Compare groups.

    • To learn more about using Office Scripts with Power Automate, see Run Office Scripts with Power Automate.

  8. Select Save.

    It can take up to 48 hours for changes to Office Scripts settings to take effect.

Manage the availability of Office Scripts in Excel desktop by using Group Policy

Group Policy has a setting to control whether Office Scripts (including the relevant commands on the Automate tab) are available for use.

If you enable this policy setting, Office Scripts will not be available for use in the installed Excel app on a desktop. You'll find Office Scripts settings under User Configuration\Administrative Templates\Microsoft Excel 2016\Miscellaneous in the Group Policy Management Console.

After applying this policy setting, users will still see the Automate tab, but the Office Scripts and Automate options will be greyed out. They can select the Record Actions button, but if they do, they'll see the following message: "You don't have access to Office Scripts. Your organization's admin may have turned off this feature, or you don't meet the requirements."

To learn more, see Use Group Policy to configure update settings for Microsoft 365 Apps.

Next steps

Because Office Scripts works with Power Automate, we recommend that you review your existing Microsoft Purview Data Loss Prevention (DLP) policies to ensure your organization's data remains protected while users use Office Scripts. For more information, see Data loss prevention (DLP) policies.

Office Scripts technical documentation (link page)
Introduction to Office Scripts in Excel (article)
Sharing Office Scripts in Excel (article)
Record, edit, and create Office Scripts in Excel (article)