Forum Discussion
Share a script
I have a script used to copy data. I can run the script in the app as well as the web. I cannot add a button to the worksheet.
I get a "We weren't able to share your script. Please try again." message. I have Microsoft 365 Copilot version 19.2604.52241.0
if that helps
Thanks Jim
1 Reply
- Olufemi7Iron Contributor
HelloJimCarr,
This is not related to your script or Copilot version. The error occurs because Excel cannot complete the share step, and a script must be shared before it can be added as a button.
In Microsoft Excel Office Scripts, adding a button requires the script to be associated with the workbook (shared). If that step fails, you will see this error.
Check the following:
Make sure the workbook is stored in OneDrive or SharePoint. Buttons do not work with local files
Confirm the script is saved and owned by you
From the Automate tab, open the script and enable “Associate with workbook”, then add the button
If it still fails, this is usually due to tenant policy restrictions or a temporary service issue, not the script
Docs:
https://support.microsoft.com/office/sharing-office-scripts-in-excel-226eddbc-3a44-4540-acfe-fccda3d1122b