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
{count} votes

2 answers

Sort by: Most helpful
  1. 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.

    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.

    0 comments No comments

Your answer

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