Forum Discussion

HadenMcAfee's avatar
HadenMcAfee
Copper Contributor
Jan 08, 2024

Run an OfficeScript via a Button

Is it possible to use Office Scripts in a way that ANY user of a workbook can run the script?

 

I followed the instructions (https://support.microsoft.com/en-us/office/sharing-office-scripts-in-excel-226eddbc-3a44-4540-acfe-fccda3d1122b) to allow users of my workbook to run the scripts via a button.

 

I'm experiencing two issues:

  1. After emailing the file to my client (at another organization), they receive the following error when attempting to click the button:
    "RUN STATUS: The button cannot run because the script was unshared. Contact the owner to share it again." - this is happening even though my settings for the script correctly show "Everyone with access to this workbook can run this script here."Error MessagePermissions
  2. Users with a personal Microsoft 365 account cannot initiate the button action at all.  As best I can tell, this is because Office Scripts are limited to the business or education subscriptions.

How can I keep the automation in this workbook, but make it available to any of my customers that would use the document?  This needs to be something I can email out to an individual, and that they can execute at the click of a button.

3 Replies

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor
    As best I can tell, this is because Office Scripts are limited to the business or education subscriptions.
    This maybe true.
    One solution maybe ask your customer can buy a business license.

    How can I keep the automation in this workbook, but make it available to any of my customers that would use the document?

    Alternative,VBA or dynamic web/Ms Form also are options.
    • HadenMcAfee's avatar
      HadenMcAfee
      Copper Contributor

      peiyezhu 

      Thank you for your feedback.

       

      I agree, a macro-enabled file would work.  In fact, that is what the original version of this file used.  However, my client was specifically hoping to transition away from VBA macros since they are now blocked by default.  They share this spreadsheet with a wide array of people, and talking them through how to enable the macros to run has been a point of frustration.

       

      If any user of a workbook could operate the button to run the script, that would allow Office Scripts to fundamentally replace VBA macros for this use case.

      • peiyezhu's avatar
        peiyezhu
        Bronze Contributor
        They share this spreadsheet with a wide array of people, and talking them through how to enable the macros to run has been a point of frustration.
        How about create a .net core exe with c# or java script run in web browser if VBA is not convenient to deploy?

Resources