Share via

Workbook button for Excel Scripts permission issue : The button cannot run because the script was unshared. Contact the owner to share it again.

Dheeraj Kaul 35 Reputation points Microsoft Employee
2024-04-23T02:46:50.49+00:00

I created 3 Excel Scripts , added buttons to the workbook for each script, and shared the excel spreadsheet through Teams, and also the scripts on sharepoint with other folks in my organization.

When they opened the excel sheet and tried to run the script from the workbook button, it asked them to "Allow" permission to the script the first time, and executed the script successfully. When they try to run it the second time, it throws the error : "The button cannot run because the script was unshared. Contact the owner to share it again." I checked the script permission, and nothing had changed, it still had the same access.

When they tried to run the script from workbook by clicking the "Run" button against the script, it ran fine, but the workbook button keeps on throwing the error, although it ran fine the first time.

Microsoft 365 and Office | Development | Other

3 answers

Sort by: Most helpful
  1. Sarah F 0 Reputation points
    2025-08-28T18:32:06.5833333+00:00

    I have the same issue but only with scripts with buttons not all of them even though its the same workbook. I own the script as well.

    All scripts run fine through the automate ribbon.

    What I've tried and all have failed:

    • Copy script code, create new script, delete the old script and button, put button in for new script
    • Delete office script folder and restart excel, move scripts there
    • Delete button create new button

    Was this answer helpful?

    0 comments No comments

  2. Mark S 0 Reputation points
    2025-06-25T07:37:13.79+00:00

    We overcame this issue and other sharing/permissions issues we were encoutering with shared office scripts by deleting the individdual users 'Office Scripts' folder that gets created in the Documens folder. As soon as we removed that and restarted excel it ran as expected every time.

    Was this answer helpful?


  3. GCS Backflow Services 0 Reputation points
    2024-06-26T14:20:40.2566667+00:00

    I have no answer but have the same problem.

    I have an Excel 365 workbook that has three scripts which are activated by a button on worksheet. It has been working property for almost 2 years. Today, for the first time, we are seeing this error when trying to run the script. I have tried replacing the button, creating a new worksheet with new buttons, but, so far, the issue still returns.

    I sure could use a proven solution.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.