XLL+ Class Library (6.3)

Security settings

During development, it can become very tedious having to constantly click past security warnings when your XLL is opened by Excel.

There are several ways round the problem during development.

Trust the directory

Under Excel 2007, you can add your source code directory to the list of "Trusted Locations". Ensure that "Sub-folders of this location are also trusted" is checked.

However, depending on your other security settings, this may be insufficient; you may also need to sign your code (see below).

Sign the code

You can use the code signing tool signtool.exe (provided as part of Visual Studio 2005) to apply a trusted signature to your file as soon as it has been built.

Post-Build Event

In the project properties window, go to the Build Events/Post-Build Event page, and set Command Line to:

signtool sign /a "$(TargetPath)"

This will sign the code with the most appropriate certificate, if any are available.

Create a signature

You can use the selfcert.exe tool to create a certificate that will work on your own machine, but will not be trusted elsewhere. This is appropriate for testing and debugging.

Change security level

You can change the macro security level of Excel to "Low". This approach is a blunt instrument, and should only be considered for a development machine in a safe network environment.

Production builds

The methods described above should only be used for debug builds and for test environments.

Production builds that create code for use on other machines should be subject to more stringent and precise security measures, as specified by your network administrator.

Next: Trouble-shooting >>