A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Dear Nikhil Narayanan,
Based on your description, kindly try these steps:
Enable third-party cookies for Excel for the web. Office Scripts requires third-party cookies in the browser. If your browser blocks them, allow third-party cookies for Microsoft 365, OneDrive, and Excel sites, then reopen the workbook in a new browser window.
Have the Microsoft 365 administrator check script sharing. In the Home - Microsoft 365 Apps admin center > Customization > Policy Management.
Open the policy configuration assigned to the affected user, or create one for a test group.
Search the policy settings and verify that these policies are enabled:
- Let users automate their tasks in Excel
- Let users with access to Office Scripts share their scripts with others in the organization
Confirm that the policy configuration is assigned to the affected user or a group containing that user.
The second policy is the relevant one for Associate with workbook, because associating a script shares it with workbook editors in the same organization.
Retest with a clean workbook. Create a blank workbook directly in your organizational OneDrive, create a simple new script in that workbook, and try Associate with workbook. If this works, the issue is isolated to the original workbook or script rather than the tenant configuration.
Recreate the script if needed. From the affected script’s menu, select Make a copy, open the copied script while the target workbook is active, and try Associate with workbook again. Copying is a supported script action and helps remove a broken script-to-file sharing reference.
Once association succeeds, select Add button to worksheet. This associates and shares the script with anyone in the organization who has permission to edit the workbook. Users with only view access cannot run the linked script.
Note: If the administrator recently changed the Office Scripts settings, the change can take up to 48 hours to take effect. Issues related to Office Scripts | Microsoft Learn
I hope the information shared helps point you in the right direction.
If the answer is helpful, please click "Yes" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in the forum documentation to enable e-mail notifications if you want to receive the related email notification for this thread.