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.
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).
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.
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.
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.
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.
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.