Share via

How can I share an Office Script for Excel to be used in a different workbook?

Heather Seeno 60 Reputation points
2026-05-27T18:55:58.4966667+00:00

I have created an Office Script in Excel for a colleague to use. Each month she imports a new csv into Excel, and this script will replace manual cleanup on her part. Is the only way for her to have access to this script for her to copy and paste the code into her code editor of a new script on her machine? We are running Excel on the web. Thnx

Microsoft 365 and Office | Excel | For business | Other
0 comments No comments

Answer accepted by question author

Kai-L 13,705 Reputation points Microsoft External Staff Moderator
2026-05-27T19:49:21.0533333+00:00

Dear @Heather Seeno,

Good day, and thank you for reaching out to the Q&A Forum. I understand that you would like to use an Office Script in Excel for the web across different workbooks without having to manually copy and paste the code each time. Since your colleague imports a new CSV each month, you are looking for a more efficient way for her to reuse the same script.

From my research, Office Scripts are stored in OneDrive by default, and they can also be stored in SharePoint, so they can be run on different workbooks and worksheets. Because of this, if your colleague already has access to the script in her script gallery, she should be able to reuse the same script on each newly imported workbook without having to recreate it manually. She can go to Automate > View Scripts > Recent Scripts, locate the script, and then run it on the new workbook.

If your colleague does not have access to the script yet, you can also share it with her by doing the following:

  • Open the workbook that contains the script in Excel for the web.
  • Go to Automate > View Scripts.
  • Find the script you want to share to open it in the Office Scripts pane.
  • Select the three dots next to the script, then choose Make a copy.
  • Choose a SharePoint folder that both you and your colleague can access.
  • Select Save.

However, this requires an active Microsoft 365 subscription with an eligible commercial or educational license that includes access to the Microsoft 365 Office desktop apps. If your colleague does not have an eligible license and is using only the web version without Office Scripts support, the script feature may not be available for normal cloud-based reuse. In that situation, manually copying and pasting the script code may be the most practical workaround.

For reference: Sharing Office Scripts in Excel - Microsoft Support

I hope this information helps clarify the situation and provides you with workable solutions. Should you have any further questions or need additional assistance, please don't hesitate to reach out. I'm always here to help. Have a wonderful day! 


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".  

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

Answer accepted by question author

Mr. Mark Ekiru 80 Reputation points
2026-05-27T19:01:12.5733333+00:00
  1. Share the script with another workbook (same account)

Office Scripts are usually saved to your Microsoft account, not inside a workbook.

To use the same script in another workbook:

  1. Open the new workbook in Excel for the web
  2. Go to the Automate tab.
  3. Open All Scripts.
  4. Your saved script should appear there automatically.
  5. Run it on the new workbook.
  6. Share the script with another person

You can share the script itself:

  1. In Excel web → Automate tab.
  2. Click All Scripts.
  3. Select the script → click the three dots (⋯).
  4. Choose Share.
  5. Send the link or permissions to the other person.

They can then copy or use the script in their own Excel files.

  1. Copy script code manually

If sharing is unavailable in your organization:

  1. Open the script editor.
  2. Copy the TypeScript code.
  3. In another workbook:

Automate → New Script

Paste the code

Save it.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Most helpful

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.