Protecting Office excel Scripts

Cool_wanderer_Jeeva 20 Reputation points
2023-08-07T10:59:13.31+00:00

I would like to share the scripts to the users but I would like to stop viewing the scripts by the user instead allow to run by a button. The same feature like VBA Project Library. Is there a workaround to make stop viewing the scripts by the user.

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Accepted answer
  1. AllenXu-MSFT 24,946 Reputation points Moderator
    2023-08-08T02:29:22.68+00:00

    Hi @Cool_wanderer_Jeeva,

    To share Office Scripts with users but prevent them from viewing the code, you can create script buttons that run the associated script when selected. This shares the script with the workbook, so everyone with write permissions to the workbook can use your helpful automation, but they won't be able to view the code. To remove the script from a button, you can go to the More options (…) menu in the script details page and select Stop sharing. This removes all the buttons that run the script. Deleting a single button removes the script from that one button, even if the operation is undone or the button is cut and pasted. It's important to note that script buttons won't work when opened in versions of Excel that don't support Office Scripts. In that case, the button still appears, but selecting it has no effect.


    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.


0 additional answers

Sort by: Most helpful

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.