Shared office scripts - Needs premission everytime it's executed

Copper Contributor

I wrote some office scripts in some excel workbooks.

Those scripts are executed by pressing a button created with what excel provides.

Co-workers in my company are supposed to use these scripts frequently.

Whenever they execute any script they are being asked if they trust the author, then they press allow and the scripts executes.

As far as I can tell this message (of trust) is supposed to be asked just for the first time any script is executed or after anything changed with a script.

However in my company they are being asked everything single time

(even after nothing changed or repeating executions after another with any same script).

 

We already tested some stuff in the Trust Center but no success yet.

 

What can I do to just get the message once or after every update of the script?

 

Note: This behavior even takes place with scripts that just print "Hello World" in the console.

1 Reply

@kvonbargen 

If your co-workers are being asked for permission every time they execute an Office script, even if nothing has changed in the script, there are a few things you can check and try to resolve this issue:

  1. Check the script's trust settings: In Excel, go to "File" > "Options" > "Trust Center" > "Trust Center Settings" > "Macro Settings." Ensure that the option "Enable all macros" or "Enable all macros (not recommended; potentially dangerous code can run)" is selected. If it is set to a more restrictive option, such as "Disable all macros with notification," it could be causing the repeated trust prompts.
  2. Check the workbook's trust settings: In Excel, open the workbook containing the script, go to "File" > "Info," and click on the "Enable All Content" button. This ensures that all macros and scripts within the workbook are enabled without prompting for permission.
  3. Sign the script with a trusted certificate: Signing the Office script with a trusted certificate can establish the script's authenticity, reducing the frequency of trust prompts. You can obtain a digital certificate from a trusted certificate authority (CA) and use it to sign your Office scripts.
  4. Store the workbook in a trusted location: If the workbook containing the script is stored in a trusted location, Excel may require fewer trust prompts. You can designate a specific folder or network location as a trusted location in Excel's trust settings.
  5. Update Excel and Office Scripts: Ensure that you and your co-workers are using the latest version of Excel and Office Scripts. Microsoft regularly releases updates that address bugs and improve security, so updating to the latest version may help resolve the issue.

The steps were processed with the help of AI.

Hope this will help you.