Jump to content

Block/Unblock Scripts in Woksheets

Recommended Posts

When adding scripts to worksheets, there is a dialog box that pops up every time saying  would you like to block or execute scripts in this worksheet?



Can we somehow block or execute this option, through a script?

Link to comment

As far as I know, that option is there as a weak form of security only. The last time I checked, it was an all or nothing affair. You either had to click ALLOW for EVERY separate worksheet script in the file or you had to Click ALWAYS ALLOW. Which would then not provide any security at all for any future scripts that got added. I submitted an enhancement request that it be changed to be able to ALWAYS ALLOW only a specific script.


I do not believe this is accessible from a script. This data is stored in the Saved Settings along with all of the other ALWAYS DO options. The only way I know of to change these settings is to reset ALL of them back to defaults and start answering the questions again.


If you (as I do) consider this to be a security setting, then you really would not want to be able to set if by a script. There would be no way to keep a malicious script from giving itself permissions and executing.

  • Like 1
Link to comment

Thanks for the reply Pat. Yes I can see the issue with security and running random scripts. Also agree with your enhancement request, to allow only a particular script. As running a  recalculate on any worksheet, seems to trigger recalcs in every other worksheet, regardless if they're open or not.




Link to comment

IIRC, when you select ALWAYS ALLOW, it is only for that session of VW. After VW restarts you will be presented with the question again. It took me a little while to figure out the scope of these selections, but I kind of like this level of intrusion. I don't have to worry about leaving the back door open forever if I forget to close it. For files of my own creation, I click ALWAYS ALLOW and keep working. If I am going to work on a questionable file, I can restart VW and I am covered again. Not ideal, but very workable.



  • Like 2
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...