To work around this behavior, use one of the following methods.
Method 1: Add a Digital Signature to the Macro
Excel runs macros that are signed by a trusted source. Obtain a digital signature, and then add the digital signature to the macro. To add the digital signature:
- Open the file that contains the macro project that you want to sign.
-
On the Tools menu, point to Macro, and then click Visual Basic Editor.
-
In Project Explorer, click the project that you want to sign.
-
On the Tools menu, click Digital Signature.
-
Click Choose, click the certificate, and then click OK. Click OK again to close the Digital Certificate dialog box.
Method 2: Change the Macro Security Level
To change the macro security level:
-
On the Tools menu, click Options.
-
Click the Security tab.
-
Under Macro Security, click Macro Security, and then
click the Security Level tab.
-
On the Security Level tab, click the security level that you want to use, and then click OK two times.
For more information about macro security, click
Microsoft Excel Help
on the
Help
menu. Type
about macro security
in the
Search
text box of
Assistance. Click
Search.
Method 3: Remove the VBA Code from the Workbook
If the functionality that your VBA code provides has a managed code equivalent, you can transition this functionality to the managed code extension. After you have transitioned the code, you can remove all the modules and code that the workbook's VBA project contains.
When you use this method, you avoid the security warning and the workbook does not open in Design Mode when the Excel macro security level is set to
High. If you cannot completely remove the VBA project from your workbook, you can move only the worksheets in the workbook to a new workbook.