How to enable macros in excel
How to enable macros in excel
Macros in Office files
A macro is a series of commands that you can use to automate a repeated task, and can be run when you have to perform the task. This article has information about the risks involved when you work with macros, and you can learn about how to enable or disable macros in the Trust Center.
Warning: Never enable macros in an Office file unless you’re sure what those macros do. Unexpected macros can pose a significant security risk. You don’t have to enable macros to see or edit the file; only if you want the functionality provided by the macro. For more information see Protect yourself from macro viruses.
If you’re looking for information on creating macros please see Quick start: Create a macro.
If you’re looking for information on using macros on a machine running Windows S see Block suspicious macros in Office on Windows 10 S.
Macros automate frequently used tasks to save time on keystrokes and mouse actions. Many were created by using Visual Basic for Applications (VBA) and are written by software developers. However, some macros can pose a potential security risk. Macros are often used by people with malicious intent to quietly install malware, such as a virus, on your computer or into your organization’s network.
Change macro settings in the Trust Center
Macro settings are located in the Trust Center. However, if your device is managed by your work or school the system administrator might prevent anyone from changing settings.
Important: When you change your macro settings in the Trust Center, they are changed only for the Office program that you are currently using. The macro settings are not changed for all your Office programs.
Click the File tab.
Click Trust Center, and then click Trust Center Settings.
In the Trust Center, click Macro Settings.
Make the selections that you want, then click OK.
Note: The options are slightly different in Excel, we’ll call those out as we go.
Disable all macros without notification Macros and security alerts about macros are disabled.
In Excel this option is Disable VBA macros without notification and it only applies to VBA macros.
Disable all macros with notification Macros are disabled, but security alerts appear if there are macros present. Enable macros on a case-by-case basis.
In Excel this option is Disable VBA macros with notification and it only applies to VBA macros.
Disable all macros except digitally signed macros Macros are disabled, and security alerts appear if there are unsigned macros present. However, if the macro is digitally signed by a trusted publisher, the macro just runs. If the macro is signed by a publisher you haven’t trusted yet, you are given the opportunity to enable the signed macro and trust the publisher.
In Excel this option is Disable VBA macros except digitally signed macros and it only applies to VBA macros.
Enable all macros (not recommended, potentially dangerous code can run) All macros run without confirmation. This setting makes your computer vulnerable to malicious code.
In Excel this option is Enable VBA macros (not recommended, potentially dangerous code can run) and it only applies to VBA macros.
Excel also has a checkbox for Enable Excel 4.0 macros when VBA macros are enabled. If you select this checkbox all of the above settings for VBA macros will also apply to Excel 4.0 (XLM) macros.
If this checkbox is not selected XLM macros are disabled without notification.
Trust access to the VBA project object model Disallow or allow programmatic access to the Visual Basic for Applications (VBA) object model from an automation client. This security option is for code written to automate an Office program and manipulate the VBA environment and object model. It is a per-user and per-application setting, and denies access by default, hindering unauthorized programs from building harmful self-replicating code. For automation clients to access the VBA object model, the user running the code must grant access. To turn on access, select the check box.
Note: Microsoft Publisher and Microsoft Access have no Trust access to the VBA project model object option.
Macros in Office files
A macro is a series of commands that you can use to automate a repeated task, and can be run when you have to perform the task. This article has information about the risks involved when you work with macros, and you can learn about how to enable or disable macros in the Trust Center.
Warning: Never enable macros in an Office file unless you’re sure what those macros do. Unexpected macros can pose a significant security risk. You don’t have to enable macros to see or edit the file; only if you want the functionality provided by the macro. For more information see Protect yourself from macro viruses.
If you’re looking for information on creating macros please see Quick start: Create a macro.
If you’re looking for information on using macros on a machine running Windows S see Block suspicious macros in Office on Windows 10 S.
Macros automate frequently used tasks to save time on keystrokes and mouse actions. Many were created by using Visual Basic for Applications (VBA) and are written by software developers. However, some macros can pose a potential security risk. Macros are often used by people with malicious intent to quietly install malware, such as a virus, on your computer or into your organization’s network.
Change macro settings in the Trust Center
Macro settings are located in the Trust Center. However, if your device is managed by your work or school the system administrator might prevent anyone from changing settings.
Important: When you change your macro settings in the Trust Center, they are changed only for the Office program that you are currently using. The macro settings are not changed for all your Office programs.
Click the File tab.
Click Trust Center, and then click Trust Center Settings.
In the Trust Center, click Macro Settings.
Make the selections that you want, then click OK.
Note: The options are slightly different in Excel, we’ll call those out as we go.
Disable all macros without notification Macros and security alerts about macros are disabled.
In Excel this option is Disable VBA macros without notification and it only applies to VBA macros.
Disable all macros with notification Macros are disabled, but security alerts appear if there are macros present. Enable macros on a case-by-case basis.
In Excel this option is Disable VBA macros with notification and it only applies to VBA macros.
Disable all macros except digitally signed macros Macros are disabled, and security alerts appear if there are unsigned macros present. However, if the macro is digitally signed by a trusted publisher, the macro just runs. If the macro is signed by a publisher you haven’t trusted yet, you are given the opportunity to enable the signed macro and trust the publisher.
In Excel this option is Disable VBA macros except digitally signed macros and it only applies to VBA macros.
Enable all macros (not recommended, potentially dangerous code can run) All macros run without confirmation. This setting makes your computer vulnerable to malicious code.
In Excel this option is Enable VBA macros (not recommended, potentially dangerous code can run) and it only applies to VBA macros.
Excel also has a checkbox for Enable Excel 4.0 macros when VBA macros are enabled. If you select this checkbox all of the above settings for VBA macros will also apply to Excel 4.0 (XLM) macros.
If this checkbox is not selected XLM macros are disabled without notification.
Trust access to the VBA project object model Disallow or allow programmatic access to the Visual Basic for Applications (VBA) object model from an automation client. This security option is for code written to automate an Office program and manipulate the VBA environment and object model. It is a per-user and per-application setting, and denies access by default, hindering unauthorized programs from building harmful self-replicating code. For automation clients to access the VBA object model, the user running the code must grant access. To turn on access, select the check box.
Note: Microsoft Publisher and Microsoft Access have no Trust access to the VBA project model object option.
Macros in Office files
A macro is a series of commands that you can use to automate a repeated task, and can be run when you have to perform the task. This article has information about the risks involved when you work with macros, and you can learn about how to enable or disable macros in the Trust Center.
Warning: Never enable macros in an Office file unless you’re sure what those macros do. Unexpected macros can pose a significant security risk. You don’t have to enable macros to see or edit the file; only if you want the functionality provided by the macro. For more information see Protect yourself from macro viruses.
If you’re looking for information on creating macros please see Quick start: Create a macro.
If you’re looking for information on using macros on a machine running Windows S see Block suspicious macros in Office on Windows 10 S.
Macros automate frequently used tasks to save time on keystrokes and mouse actions. Many were created by using Visual Basic for Applications (VBA) and are written by software developers. However, some macros can pose a potential security risk. Macros are often used by people with malicious intent to quietly install malware, such as a virus, on your computer or into your organization’s network.
Change macro settings in the Trust Center
Macro settings are located in the Trust Center. However, if your device is managed by your work or school the system administrator might prevent anyone from changing settings.
Important: When you change your macro settings in the Trust Center, they are changed only for the Office program that you are currently using. The macro settings are not changed for all your Office programs.
Click the File tab.
Click Trust Center, and then click Trust Center Settings.
In the Trust Center, click Macro Settings.
Make the selections that you want, then click OK.
Note: The options are slightly different in Excel, we’ll call those out as we go.
Disable all macros without notification Macros and security alerts about macros are disabled.
In Excel this option is Disable VBA macros without notification and it only applies to VBA macros.
Disable all macros with notification Macros are disabled, but security alerts appear if there are macros present. Enable macros on a case-by-case basis.
In Excel this option is Disable VBA macros with notification and it only applies to VBA macros.
Disable all macros except digitally signed macros Macros are disabled, and security alerts appear if there are unsigned macros present. However, if the macro is digitally signed by a trusted publisher, the macro just runs. If the macro is signed by a publisher you haven’t trusted yet, you are given the opportunity to enable the signed macro and trust the publisher.
In Excel this option is Disable VBA macros except digitally signed macros and it only applies to VBA macros.
Enable all macros (not recommended, potentially dangerous code can run) All macros run without confirmation. This setting makes your computer vulnerable to malicious code.
In Excel this option is Enable VBA macros (not recommended, potentially dangerous code can run) and it only applies to VBA macros.
Excel also has a checkbox for Enable Excel 4.0 macros when VBA macros are enabled. If you select this checkbox all of the above settings for VBA macros will also apply to Excel 4.0 (XLM) macros.
If this checkbox is not selected XLM macros are disabled without notification.
Trust access to the VBA project object model Disallow or allow programmatic access to the Visual Basic for Applications (VBA) object model from an automation client. This security option is for code written to automate an Office program and manipulate the VBA environment and object model. It is a per-user and per-application setting, and denies access by default, hindering unauthorized programs from building harmful self-replicating code. For automation clients to access the VBA object model, the user running the code must grant access. To turn on access, select the check box.
Note: Microsoft Publisher and Microsoft Access have no Trust access to the VBA project model object option.
Change macro security settings in Excel
In Excel, you can change the macro security settings to control which macros run and under what circumstances when you open a workbook. For example, you might allow macros to run based on whether they are digitally signed by a trusted developer.
For more information about macro security settings in Microsoft Office documents, see Enable or disable macros in Office files.
The following list summarizes the various macro security settings. Under all settings, if antivirus software that works with Microsoft Office is installed and the workbook contains macros, the workbook is scanned for known viruses before it is opened.
Disable all macros without notification Click this option if you don’t trust macros. All macros in documents and security alerts about macros are disabled. If there are documents that contain unsigned macros that you do trust, you can put those documents into a trusted location. Documents in trusted locations are allowed to run without being checked by the Trust Center security system.
Disable all macros with notification This is the default setting. Click this option if you want macros to be disabled, but you want to get security alerts if there are macros present. This way, you can choose when to enable those macros on a case by case basis.
Disable all macros except digitally signed macros This setting is the same as the Disable all macros with notification option, except that if the macro is digitally signed by a trusted publisher, the macro can run if you have already trusted the publisher. If you have not trusted the publisher, you are notified. That way, you can choose to enable those signed macros or trust the publisher. All unsigned macros are disabled without notification.
Enable all macros (not recommended, potentially dangerous code can run) Click this option to allow all macros to run. Using this setting makes your computer vulnerable to potentially malicious code and is not recommended.
Trust access to the VBA project object model This setting is for developers and is used to deliberately lock out or allow programmatic access to the VBA object model from any Automation client. In other words, it provides a security option for code that is written to automate an Office program and programmatically manipulate the Microsoft Visual Basic for Applications (VBA) environment and object model. This is a per user and per application setting, and denies access by default. This security option makes it more difficult for unauthorized programs to build «self-replicating» code that can harm end-user systems. For any Automation client to be able to access the VBA object model programmatically, the user running the code must explicitly grant access. To turn on access, select the check box.
Office uses Microsoft Authenticode technology to enable macro creators to digitally sign a file or a macro project. The certificate that is used to create this signature confirms that the macro or document originated from the signer, and the signature confirms that the macro or document has not been altered.
After you install your digital certificate, you can sign files and macro projects.
Obtaining a digital certificate for signing
You can obtain a digital certificate from a commercial certificate authority (CA), or from your internal security administrator or information technology (IT) professional.
To learn more about certificate authorities that offer services for Microsoft products, see the list of Microsoft Root Certificate Program Members.
Creating your own digital certificate for self-signing
You can also create your own self-signing certificate by using the Selfcert.exe tool.
Note: Because a digital certificate that you create isn’t issued by a formal certificate authority, macro projects that are signed by using such a certificate are referred to as self-signed projects. Microsoft Office trusts a self-signed certificate only on a computer that has that certificate in your Personal Certificates store.
For more information about how to digitally sign a macro, see Digitally sign a macro project.
Change macro security settings
You can change macro security settings in the Trust Center, unless a system administrator in your organization has changed the default settings to prevent you from changing the settings.
On the Developer tab, in the Code group, click Macro Security.
To enable the Developer tab, see Show the Developer tab.
In the Macro Settings category, under Macro Settings, click the option that you want.
Note: Any changes that you make in the Macro Settings category in Excel apply only to Excel and do not affect any other Microsoft Office program.
You can also access the Trust Center in Excel Options. To do that, click Options (Excel 2010 to 2016 versions) or Microsoft Office Button (Excel 2007), and then click Trust Center > Trust Center Settings > Macro Settings.
For more information about macro security, see the following topics:
Troubleshooting
I can’t change my macro security settings
Some users may not be able to change Trust Center settings due to group security policies in their organizations. In such cases, you need to contact the IT administrator for your organization.
What happened to the Very High, High, Medium, and Low security settings?
Excel 2003 setting
Excel 2007/2010/2013/2016 equivalent
Disable all macros without notification
In Excel 2003, VBA macros can run only if the Trust all installed add-ins and templates option (in Excel 2003, the Trusted Publishers tab in the Security dialog box) is selected and the macros (whether signed or unsigned) are stored in a specific trusted folder on the user’s hard disk.
If not all of these conditions are met, VBA macros cannot run under the Very High security setting in Excel 2003.
Disable all macros except digitally signed macros
By default, all Office 2003 programs are installed with macro security set to High.
Disable all macros with notification
In Excel 2003, users are prompted to enable or disable executables when a document is opened. This level requires the acceptance of a certificate of trust for each executable, which is accepted by adding the certificate to a segment of the computer’s Windows registry.
Subsequent requests to run a macro from a trusted source are automatically accepted (the executable runs without prompting the user).
Enable all macros (not recommended; potentially dangerous code can run)
In Excel 2003, all macros are run without restrictions. This security level does not protect against malicious programs, does not allow for acceptance of certificates of trust, and is not considered secure in general. This level is not recommended.
Need more help?
You can always ask an expert in the Excel Tech Community or get support in the Answers community.
Change macro security settings in Excel
In Excel, you can change the macro security settings to control which macros run and under what circumstances when you open a workbook. For example, you might allow macros to run based on whether they are digitally signed by a trusted developer.
For more information about macro security settings in Microsoft Office documents, see Enable or disable macros in Office files.
The following list summarizes the various macro security settings. Under all settings, if antivirus software that works with Microsoft Office is installed and the workbook contains macros, the workbook is scanned for known viruses before it is opened.
Disable all macros without notification Click this option if you don’t trust macros. All macros in documents and security alerts about macros are disabled. If there are documents that contain unsigned macros that you do trust, you can put those documents into a trusted location. Documents in trusted locations are allowed to run without being checked by the Trust Center security system.
Disable all macros with notification This is the default setting. Click this option if you want macros to be disabled, but you want to get security alerts if there are macros present. This way, you can choose when to enable those macros on a case by case basis.
Disable all macros except digitally signed macros This setting is the same as the Disable all macros with notification option, except that if the macro is digitally signed by a trusted publisher, the macro can run if you have already trusted the publisher. If you have not trusted the publisher, you are notified. That way, you can choose to enable those signed macros or trust the publisher. All unsigned macros are disabled without notification.
Enable all macros (not recommended, potentially dangerous code can run) Click this option to allow all macros to run. Using this setting makes your computer vulnerable to potentially malicious code and is not recommended.
Trust access to the VBA project object model This setting is for developers and is used to deliberately lock out or allow programmatic access to the VBA object model from any Automation client. In other words, it provides a security option for code that is written to automate an Office program and programmatically manipulate the Microsoft Visual Basic for Applications (VBA) environment and object model. This is a per user and per application setting, and denies access by default. This security option makes it more difficult for unauthorized programs to build «self-replicating» code that can harm end-user systems. For any Automation client to be able to access the VBA object model programmatically, the user running the code must explicitly grant access. To turn on access, select the check box.
Office uses Microsoft Authenticode technology to enable macro creators to digitally sign a file or a macro project. The certificate that is used to create this signature confirms that the macro or document originated from the signer, and the signature confirms that the macro or document has not been altered.
After you install your digital certificate, you can sign files and macro projects.
Obtaining a digital certificate for signing
You can obtain a digital certificate from a commercial certificate authority (CA), or from your internal security administrator or information technology (IT) professional.
To learn more about certificate authorities that offer services for Microsoft products, see the list of Microsoft Root Certificate Program Members.
Creating your own digital certificate for self-signing
You can also create your own self-signing certificate by using the Selfcert.exe tool.
Note: Because a digital certificate that you create isn’t issued by a formal certificate authority, macro projects that are signed by using such a certificate are referred to as self-signed projects. Microsoft Office trusts a self-signed certificate only on a computer that has that certificate in your Personal Certificates store.
For more information about how to digitally sign a macro, see Digitally sign a macro project.
Change macro security settings
You can change macro security settings in the Trust Center, unless a system administrator in your organization has changed the default settings to prevent you from changing the settings.
On the Developer tab, in the Code group, click Macro Security.
To enable the Developer tab, see Show the Developer tab.
In the Macro Settings category, under Macro Settings, click the option that you want.
Note: Any changes that you make in the Macro Settings category in Excel apply only to Excel and do not affect any other Microsoft Office program.
You can also access the Trust Center in Excel Options. To do that, click Options (Excel 2010 to 2016 versions) or Microsoft Office Button (Excel 2007), and then click Trust Center > Trust Center Settings > Macro Settings.
For more information about macro security, see the following topics:
Troubleshooting
I can’t change my macro security settings
Some users may not be able to change Trust Center settings due to group security policies in their organizations. In such cases, you need to contact the IT administrator for your organization.
What happened to the Very High, High, Medium, and Low security settings?
Excel 2003 setting
Excel 2007/2010/2013/2016 equivalent
Disable all macros without notification
In Excel 2003, VBA macros can run only if the Trust all installed add-ins and templates option (in Excel 2003, the Trusted Publishers tab in the Security dialog box) is selected and the macros (whether signed or unsigned) are stored in a specific trusted folder on the user’s hard disk.
If not all of these conditions are met, VBA macros cannot run under the Very High security setting in Excel 2003.
Disable all macros except digitally signed macros
By default, all Office 2003 programs are installed with macro security set to High.
Disable all macros with notification
In Excel 2003, users are prompted to enable or disable executables when a document is opened. This level requires the acceptance of a certificate of trust for each executable, which is accepted by adding the certificate to a segment of the computer’s Windows registry.
Subsequent requests to run a macro from a trusted source are automatically accepted (the executable runs without prompting the user).
Enable all macros (not recommended; potentially dangerous code can run)
In Excel 2003, all macros are run without restrictions. This security level does not protect against malicious programs, does not allow for acceptance of certificates of trust, and is not considered secure in general. This level is not recommended.
Need more help?
You can always ask an expert in the Excel Tech Community or get support in the Answers community.
Источники информации:
- http://support.microsoft.com/en-gb/office/macros-in-office-files-12b036fd-d140-4e74-b45e-16fed1a7e5c6
- http://support.microsoft.com/en-us/office/macros-in-office-files-12b036fd-d140-4e74-b45e-16fed1a7e5c6
- http://support.microsoft.com/en-au/office/change-macro-security-settings-in-excel-a97c09d2-c082-46b8-b19f-e8621e8fe373
- http://support.microsoft.com/en-us/office/change-macro-security-settings-in-excel-a97c09d2-c082-46b8-b19f-e8621e8fe373