Set .NET Security Policies

In order for the Office Toolkit Loader to start the assembly, that assembly must have Full Trust permissions on the user’s machine. The Microsoft Office Project Wizard automatically sets this permission on your machine, but if you move the project or deploy it, you will need to set the permission using the .NET Configuration Tool.

To set Full Trust permissions for the Excel project’s assembly on your machine:

  1. From the Control Panel, choose Administrative Tools and run the .NET Framework Wizard’s utility for the most recent version of the .NET Framework installed on your machine.

  2. Select Trust an Assembly Wizard. The Trust an Assembly Wizard starts and displays Step 1. Click Next.

  3. Enter the address of the assembly (.dll), as shown in Figure 25-14, and click Next.

  4. Set the level of trust to Full Trust, as shown in Figure 25-15, and click Next and then Finish to update your .NET security configuration.

Set the location and name of the Excel application assembly

Figure 25-14. Set the location and name of the Excel application assembly

Set Full Trust for the Excel application assembly

Figure 25-15. Set Full Trust for the Excel application assembly

You can view the .NET Framework security settings for .NET Office projects by starting the .NET Configuration Administrative Tool and expanding the My Computer, Runtime Security Policy, User, Code Groups, All_Code, Office_Projects treeview ...

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.