Link to home
Start Free TrialLog in
Avatar of mail2clk
mail2clk

asked on

Excel 2007 Macro Security

How do I permanently enable Macros so that when Excel opens a spreadsheet with macros, it automatically enabes it?
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

The easy way to do this is to put trusted macros into a TRUSTED location.

https://www.experts-exchange.com/questions/26923514/How-to-open-an-xlsm-file-with-Macros-ENABLED-always.html?anchorAnswerId=35272825#a35272825

Otherwise, attach a certificate to it (another answer in the same link)
ASKER CERTIFIED SOLUTION
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Of course, there are other options as discussed in the linked question, but unless you are really brave, don't disable Macro security completely.
An unofficial digital certificate can be added to an Excel workbook so that, after a one time interaction with the user where the user either allows or disallows that digital certificate, the user can then repeatedly open the workbook and run macros without any warnings at all, even if their security setting is high. Note that a network administrator can lock the list of trusted sources and prevent a user from adding the certificate to the list rendering this technique ineffective. Also note that the user will not be able to run signed macros if the security setting is set to Very High (the Very High setting was introduced in Excel 2003.)

An extended description of how to create and use digital certificates can be found at http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=194. A brief tutorial is included below.

To create a free unsecured code-signing digital certificate locate and run SelfCert.exe. It is an optional utility installed as part of the Office installation found in the Office installation directory. If not found, open the Add/Remove Programs control panel, run the Office Installer, and install Digital Signature for VBA projects under Office Tools. When run SelfCert asks for a name - enter any meaningful name or description. The text entered is displayed to the user whenever they are asked to accept or decline the digital certificate. For more information see http://support.microsoft.com/default.aspx?scid=kb;en-us;Q217221.

Once the digital certificate has been created on the development system, open the workbook and press ALT+F11 to open the VBE. Select the menu command Tools->Digital Signature. Click Choose and select the desired digital certificate (they are listed by name.) Click OK. Click OK again. The workbook now contains a digital signature. Since the development system already has the digital signature installed, the workbook will now open on that system without any macro warning prompt.

To allow the workbook to run without the macro security warning on another system the digital certificate has to be installed on those systems as well. Copy the workbook to a target system and open it. Excel will present the Security Warning dialog. Click Details to show the Digital Signature Details dialog. Click View Certificate to show the Certificate dialog. Click Install Certificate. Click Next twice and then Finish. Click Yes when the prompt is displayed asking if the certificate should be installed. Click OK on the completion dialog. Click OK twice more to close the widows. Click Enable Macros on the Security Warning to open the workbook. The next time the workbook is opened the same security dialog will be displayed and the check box "Always trust macros from this publisher" will be enabled - check it on and click "Enable Macros". In the future any workbook with that digital certificate installed will open without a macro security warning.

A certificate can also be installed by sending just the certificate as a separate file. To create the certificate file, open the "Internet Options" control panel, navigate to the Content tab, click Certificates, select the certificate, click Export, click Next three times, click Browse and navigate to a known folder, enter a certificate file name, click Save, click Next, click Finish, click OK, click Close to close the Certificates dialog, and click OK to close the "Internet Options" control panel. The certificate file can be sent to anyone and, when opened, will display the Certificate dialog. Clicking "Install Certificate" leads the user through the same installation process described above. Once installed, all workbooks with that digital signature will open without any warnings.

Since it is relatively easy for someone to forge an unsecured digital certificate and place it in a malicious workbook, this method of avoiding macro security warnings may not be an acceptable solution. In the event that a decision is made to abandon this technique the installed digital certificates can be easily removed by opening the Internet Options dialog from either Internet Explorer or from the control panels and navigating to the Content tab. Click on Certificates. Find the certificates to be deleted (they should be in either the Trusted Root Certification Authorities or Other People section,) selecting them, and click the Remove command button. Click Done when finished.

If true security is required then a secure digital certificate can be purchased from any of the many Certificate Authorities. See Microsoft's list of Certificate Authorities at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/rootcertprog.asp. Certificates are purchased for periods of time and average $500 per year.

For more information on macro security settings in Office, see http://office.microsoft.com/en-us/assistance/HA011362661033.aspx.

Kevin