Excel and enable macros

Excel for Microsoft 365 Word for Microsoft 365 Outlook for Microsoft 365 PowerPoint for Microsoft 365 Access for Microsoft 365 Excel 2021 Word 2021 Outlook 2021 PowerPoint 2021 Access 2021 Visio Professional 2021 Visio Standard 2021 Excel 2019 Word 2019 Outlook 2019 PowerPoint 2019 Access 2019 Visio Professional 2019 Visio Standard 2019 Excel 2016 Word 2016 Outlook 2016 PowerPoint 2016 Access 2016 Visio Professional 2016 Visio Standard 2016 Excel 2013 Word 2013 Outlook 2013 PowerPoint 2013 Access 2013 Visio Professional 2013 Visio 2013 Excel 2010 Word 2010 Outlook 2010 PowerPoint 2010 Access 2010 Visio Premium 2010 Visio 2010 Visio Standard 2010 Excel Starter 2010 More…Less

A macro is a series of commands used to automate a repeated task and can be run when you have to perform the task. Macros can automate frequently used tasks to save time on keystrokes and mouse actions.

However, some macros can pose a 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.

Warning: Never enable macros in a Microsoft 365 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.

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 Microsoft 365 program that you are currently using. The macro settings are not changed for all your Microsoft 365 programs.

  1. Click the File tab.

  2. Click Options.

  3. Click Trust Center, and then click Trust Center Settings.

  4. In the Trust Center, click Macro Settings.

    macro settings area of trust center

  5. 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 a Microsoft 365 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.

For info on creating macros please see Quick start: Create a macro.

For info on using macros on a machine running Windows S see Block suspicious macros in Office on Windows 10 S.

See Also

Change macro security settings in Excel

How malware can infect your PC

Need more help?

To enable macros simply means to run or execute a macro in a particular file in order to save the time spent on repetitive actions. To enable macros, select “enable all macros” from the “trust center” of the File tab (in the “options” button).

It is risky to enable macros because there is a possibility of running into errors while opening a macro-enabled worksheet. Consequently, on account of security reasons, Excel disables macros from external sources.

Table of contents
  • Enable Macros in Excel
    • How to Enable Macros in Excel (2007, 2010, 2013, and 2016)?
    • How to Enable all Macro Files in Excel Permanently?
    • The Cautions While Enabling Macros
    • Frequently Asked Questions
    • Recommended Articles

How to Enable Macros in Excel (2007, 2010, 2013, and 2016)?

At the foremost, the user should decide the extent of permission to be given while enabling macros. The consent can be partial, complete or zero (no permission).

Once decided on the extent of permission, follow the listed steps to enable excel macros:

  1. In the File tab, click “options.”

    enable macros in excel example 1.1

  2. In the “Excel options” dialog box, click “trust center settings” in the “trust center” option.

    enable macros in excel example 1.2

  3. From the “macro settings,” select the extent of permission to be granted. Depending on the requirement, the user can choose one of the following options (shown in the succeeding image):

    • “Disable all macros without notification” does not send any notifications regarding the disabled macros.
    • “Disable all macros with notification” sends notifications stating that macros of the current file are disabled.
    • “Disable all macros except digitally signed macros” stops the usage of all macros except the digitally signed ones.
    • “Enable all macros” gives full permission to run all macros.

    Click “Ok” to apply the selected macro settings.

    Note: The option “enable all macros” is selected only if the source is trusted.

    enable-macros-in-excel-example-1.3

  4. In the “ActiveX settings” option (under “trust center settings”), select “enable all controls without restrictions and without prompting.”

    The ActiveX controls are activated to enable macros properly. These controls are necessary for the object of macros.

    enable-macros-in-excel-example-1.4

How to Enable all Macro Files in Excel Permanently?

If a file received from a trusted source contains a macro or VBA content, the macros need to be enabled for using the file. In such cases, the macros are enabled permanently to save time.

The steps to enable macros in Excel permanently are listed as follows:

Step 1: In the File tab, click “options.”

enable macros in excel example 1.1

Step 2: In the “Excel options” dialog box, click “trust center settings” in the “trust center” option.

Excel Options

Step 3: In the “macro settings” option, select “enable all macros.” Click “Ok” to apply the selected macro settings.

Trust center

The Cautions While Enabling Macros

The following points must be remembered while enabling macros:

  • The file containing VBA codeVBA code refers to a set of instructions written by the user in the Visual Basic Applications programming language on a Visual Basic Editor (VBE) to perform a specific task.read more must be saved as “macro-enabled workbook.” Saving the file with some other extension does not save the VBA code and thus, does not enable the macros.
  • The option “enable all macros” runs all macros without any further warning or consent. Since the macros of both trusted and non-trusted sources are enabled, it might become dangerous.
  • The option “disable all macros without any notification” does not inform the reason behind why macros are not running. Hence, select “disable all macros with notification” to view the warnings.

Frequently Asked Questions

1. How to enable macros in 2007, 2010, 2013, and 2016?

a. For Excel 2007, 2010, 2013, and 2016
• In “options” under the File tab, click “trust center.”
• In “trust center settings,” click “macro settings” and choose any of the four options depending on the extent of permission to be granted. Click “Ok.”

b. For Excel 2010, 2013, and 2016
• Via the security warning bar
o Click “enable content” on the warning bar.

• Via the security warning area
o In the File tab, click “enable content” in the security warning area.
o In “advanced options,” click “enable content for this session” (under “Microsoft office security options” dialog box). Click “Ok.”

Note: This feature (security warning area) enables macros for the current session. Closing and reopening the file will display the warning again.

2. Why should macros in Excel be enabled?

Excel Macros are a set of commands or instructions that automate repetitive actions performed by the user. To enable macros implies running a macro with or without the user confirmation.

Macros are enabled to quickly complete tasks and minimize the time spent on keystrokes. Such tasks can be formatting data, creating pre-defined programs, executing specially designed functions, and so on.

Note: The macros must be enabled only if they are from a trusted and authentic source.

3. Is it safe to enable macros in Excel?

It is safe to enable only those macros that come from trusted sources or have been self-recorded by the user. All other macros that come from unknown and non-trusted sources pose an inherent security risk.

Running a malicious macro may damage the hard drive, corrupt installation of MS Office or delete essential data files. On account of this reason, the default setting is “disable all macros with notification” in Excel.

Hence, though enabling macros can be beneficial for the user, running unknown macros can be equally harmful.

Recommended Articles

This has been a guide to enable macros in Excel 2007, 2010, 2013, and 2016. Here we discuss how to enable macros in Excel for different types of permission along with examples. You may also look at these useful functions in Excel –

  • Excel Dynamic ConsolidateConsolidate is an inbuilt function in excel which is used to consolidate data from different workbooks which are opened at the same time. It allows to select multiple data from different workbooks and consolidate it in a final workbook.read more
  • Record Macros in Excel
  • Consolidate Data in Excel
  • VBA MacrosVBA Macros are the lines of code that instruct the excel to do specific tasks, i.e., once the code is written in Visual Basic Editor (VBE), the user can quickly execute the same task at any time in the workbook. It thus eliminates the repetitive, monotonous tasks and automates the process.read more
  • Drawing in ExcelDrawing in Excel means making a shape in Excel. Now, Excel has provided us with many tools for drawing. Some of them are the predefined drawings or predefined shapes, and also, there is an option for a free form of drawing where the user can design a drawing by using a mouse. It is available in the “Shapes” in Excel’s “Insert” tab.read more

Reader Interactions

Содержание

  • Включение и отключение макросов через меню разработчика
  • Включение и отключение макросов через параметры программы
  • Включение и отключение макросов в других версиях Excel
  • Вопросы и ответы

Макросы в Microsoft Excel

Макросы – это инструмент для создания команд в приложении Microsoft Excel, которые позволяют значительно сократить время на выполнение задач, автоматизировав процесс. Но, в то же время, макросы являются источником уязвимости, которой могут воспользоваться злоумышленники. Поэтому, пользователь на свой страх и риск должен решить применять данную возможность в конкретном случае, или нет. Например, если он не уверен в благонадежности открываемого файла, то лучше макросами не пользоваться, ведь они могут послужить причиной заражения компьютера вредоносным кодом. Учитывая это, разработчики предоставили возможность пользователю самому решать вопрос включения и отключения макросов.

Включение и отключение макросов через меню разработчика

Основное внимание мы уделим процедуре включения и отключения макросов в самой популярной и распространённой на сегодня версии программы — Excel 2010. Потом, более бегло поговорим о том, как это сделать в других версиях приложения.

Включить или отключить макросы в Microsoft Excel можно через меню разработчика. Но, проблема состоит в том, что по умолчанию данное меню отключено. Чтобы его включить, переходим во вкладку «Файл». Далее, кликаем по пункту «Параметры».

Переход в параметры Microsoft Excel

В открывшемся окне параметров, переходим в раздел «Настройка ленты». В правой части окна данного раздела устанавливаем галочку около пункта «Разработчик». Жмем на кнопку «OK».

Включение режима разработчика в Microsoft Excel

После этого, на ленте появляется вкладка «Разработчик».

Переходим во вкладку «Разработчик». В самой правой части ленты расположен блок настроек «Макросы». Чтобы включить или отключить макросы, кликаем по кнопке «Безопасность макросов».

Переход в раздел безопасности макросов в Microsoft Excel

Открывается окно центра управления безопасностью в разделе «Макросы». Для того, чтобы включить макросы, переставляем переключатель в позицию «Включить все макросы». Правда, данное действие разработчик не рекомендует выполнять в целях безопасности. Так что, всё выполняется на свой страх и риск. Жмем на кнопку «OK», которая расположена в нижнем правом углу окна.

Включение макросов в Microsoft Excel

Отключаются макросы тоже в этом же окне. Но, существует три варианта отключения, один из которых пользователь должен выбрать в соответствии с ожидаемым уровнем риска:

  1. Отключить все макросы без уведомления;
  2. Отключить все макросы с уведомлением;
  3. Отключить все макросы, кроме макросов с цифровой подписью.

В последнем случае, макросы, у которых будет иметься цифровая подпись, смогут выполнять задачи. Не забываем жать на кнопку «OK».

Отключение макросов в Microsoft Excel

Lumpics.ru

Включение и отключение макросов через параметры программы

Существует ещё один способ включения и отключения макросов. Прежде всего, переходим в раздел «Файл», и там жмем на кнопку «Параметры», как и в случае включения меню разработчика, о чем мы говорили выше. Но, в открывшемся окне параметров, переходим не в пункт «Настройка ленты», а в пункт «Центр управления безопасностью». Кликаем по кнопке «Параметры центра управления безопасностью».

Переход в параметры центра управлением безопасностью в Microsoft Excel

Открывается то же самое окно Центра управления безопасностью, в которое мы переходили через меню разработчика. Переходим в раздел «Параметры макросов», и там включаем или отключаем макросы тем же способом, как делали это в прошлый раз.

Параметры макросов в Microsoft Excel

В других версиях программы Excel процедура отключения макросов несколько отличается от указанного выше алгоритма.

В более новой, но менее распространенной версии программы Excel 2013, несмотря на некоторую разницу в интерфейсе приложения, процедура включения и отключения макросов происходит по тому же алгоритму, который был описан выше, а вот у более ранних версий он несколько отличается.

Для того, чтобы включить или отключить макросы в программе Excel 2007, нужно сразу кликнуть по логотипу Microsoft Office в верхнем левом углу окна, а затем в нижней части открывшейся страницы нажать на кнопку «Параметры». Далее, открывается окно Центра управления безопасностью, и дальнейшие действия по включению и отключению макросов практически ничем не отличаются от описанных для Excel 2010.

В версии Excel 2007 достаточно просто последовательно перейти по пунктам меню «Сервис», «Макрос» и «Безопасность». После этого, откроется окно, в котором нужно выбрать один из уровней безопасность работы макросов: «Очень высокая», «Высокая», «Средняя» и «Низкая». Эти параметры соответствуют пунктам параметров макросов более поздних версий.

Как видим, включить макросы в последних версиях программы Excel несколько сложнее, чем это было в предыдущих версиях приложения. Это связано с политикой разработчика на увеличение уровня безопасности пользователя. Таким образом, макросы может включить только более или менее «продвинутый» пользователь, который способен объективно оценить риски от выполняемых действий.

Macros can be defined as a set of instructions that can be used to perform some specific tasks in Microsoft Office applications. The availability of macros is very helpful for the users as they can create user defined programs and functions specifically designed to perform their tasks.

Although macros are so useful, but if misused they can play a havoc with your data or even with your computer. If unknowingly you run some malicious macro, then it could corrupt your Microsoft Office installation or give you other sorts of problems. And because of this reason Microsoft has disabled external (or un-trusted) macros by default.

Today in this post I will let you know how to enable macros in excel:

Enabling Macros in Excel 2000 and 2003:                

  • First of all navigate to ‘Tools’ tab > ‘Macro’ > ‘Security’.
  • After clicking on the ‘Security’ option, a Security window will open. It will show you all the security levels that you can select for your macros.

Enabling 2003 macros

  • My suggestion would be, never choose ‘Low Security’. ‘Medium Security’ is better as it will ask your permission each time before running a macro.

Enable Macros in Excel 2007:

  • With an excel file opened click on the ‘Office’ button.
  • Then click on ‘Excel Options’ (present at the bottom).
  • Next select the ‘Trust Center’ > ‘Trust Center Settings’.

Macro_Security_in_Excel-2007

  • In the trust centre settings click on the ‘Macro Settings’ .And from there you can choose the security level for running macros.

Enabling Macros in Excel 2010 and 2013:

  • Open a Microsoft Excel file, and navigate to ‘File’ > ‘Options’ > ‘Trust Center’. And then click ‘Trust Center Settings’.

TrustCentre in Excel 2013

  • In the Trust Center Settings window select the ‘Macro Settings’ option. And choose the security setting that you want to be applicable on macro execution.

Detailed Explanation of Macro Settings (For Excel 2007, 2010 and 2013):                                                    

The various security options in Microsoft excel 2007, 2010 and 2013 are not very clear. So, here I will explain these options in detail:

1. Disable all macros without notification: If you select this option then it will block all the macros and won’t give you any notifications about it.

2. Disable all macros with notification: In this settings the macros are disabled but still each time when you open an excel sheet with a macro it will ask you if you want to run the macro or not.

How to enable macros in excel

3. Disable all macros except digitally signed macros: This is same as the second option except the difference that it automatically allows the macros that are signed by trusted publishers.

4. Enable all macros (not recommended, potentially dangerous code can run): This setting will allow all the macros to run without prompting you. Generally you should avoid using this option.

How to Run a Macro Even if Running Macros is disabled:

You can run macros even if your security settings are not allowing you to do so. This method will only work in Excel 2007 and later versions. Microsoft Excel treats certain locations as trusted zones. This means if you store your excel files (obviously I am talking about macro enabled ones) on these trusted locations and then try to run macros. Excel will omit all the macro checks and will run the macro.

By default these trusted Locations are:

  1. Program FilesMicrosoft OfficeTemplates
  2. Program FilesMicrosoft OfficeOffice12Startup
  3. Program FilesMicrosoft OfficeOffice12Library
  4. Program FilesMicrosoft OfficeOffice12XLSTART

You can also add any location on your computer to trusted zone. To do so simply follow below steps:

  • In Excel navigate to ‘File’ > ‘Options’ > ‘Trust Center’> ‘Trust Center Settings’ > ‘Trusted Locations’.

Trusted Locations in Excel 2013

  • Next, using the ‘Add New Location’ button you can add any location to the Trusted Locations.

Note: Before adding any location to trusted location list make sure the location is really a safe location. Because these locations can act as loopholes in your security setting and any hacker can easily take advantage of such loopholes.

So, this was all about how to enable macros in Excel.

A macro is a set of commands that you can use to automate a repetitive task and run whenever you need to. This article discusses the risks associated with working with macros, as well as how to enable or disable macros in the Trust Center. Using macros in Excel reduces human error and saves time by automating repetitive tasks.

Macro security in Excel

Before you enable macros in your worksheets, you should understand how dangerous they can be.

Though VBA (Visual Basic for Applications) codes are extremely effective at automating complex and repetitive tasks, they pose a significant security risk. Unintentionally running a malicious macro can damage or completely delete files on your hard drive, corrupt your data, and even corrupt your Microsoft Office installation. As a result, the default setting in Excel is to disable all macros with notification.

How can these dangers be avoided? Simply follow one simple rule: enable only safe macros – those you’ve written or recorded yourself, macros from reliable sources, and VBA codes you’ve thoroughly reviewed and comprehended.

How to Enable macros for individual workbooks?

Macros can be enabled for a specific file in two ways: directly from the workbook and via the Backstage view.

1. Enable macros directly via security notice:

When you first open a workbook containing macros with the default macro settings, the yellow security warning bar appears at the top of the sheet, right under the ribbon:

The Microsoft Excel Security Notice will be displayed if the Visual Basic Editor is open at the time you open the file with macros:

If you are confident in the file’s origin and that all macros are safe, click the Enable Content or Enable Macros button. This activates the macros and marks the file as a trusted document. 

2. Turn on macros in Backstage view:

The Office Backstage view is another way to enable macros for a specific workbook. Here’s how to do it:

  • Click the File tab, then Info from the left menu.
  • Click Enable Content > Enable All Content, in the Security Warning area.

Your workbook, like the previous method, will become a trusted document.

How to Enable macros for one session?

In some cases, enabling macros for a single instance makes sense. For example, suppose you received an Excel file containing VBA code that you want to investigate but do not want to make it a trusted document.

The steps below will walk you through the process of enabling macros for the duration of the file’s open state:

  1. Navigate to the File tab > Info.
  2. Click Enable Content > Advanced Options in the Security Warning area.
  3. Select Enable content for this session in the Microsoft Office Security Options dialogue box, then click OK.

This enables macros for a single-use. The warning will reappear if you close and then reopen the workbook.

How to Enable macros in all workbooks through the Trust Center?

Microsoft Excel decides whether to allow or disallow VBA code execution based on the macro setting selected in the Trust Center, which is where you configure all of Excel’s security settings.

To enable macros by default in all Excel workbooks, follow these steps:

  • Navigate to the File tab and then to Options.
  • Select Trust Center from the left-hand pane and then click on Trust center setting.

  • In the Trust Center dialog box, click Macro Settings on the left, select Enable all macros and click OK.

Notes: The option you select in the Trust Center becomes the new default macro setting for all of your Excel files. Instead, if you only want to enable macros for specific workbooks, save them in a trusted location.

How to Enable macros permanently in a trusted location?

Rather than tampering with the global macro settings, you can instruct Excel to trust specific locations on your computer or local network.

Follow these steps to view the current trusted locations or to add a new one:

  • Navigate to File > Options.
  • Select Trust Center from the left-hand pane, and then click Trust Center Settings.
  • On the left side of the Trust Center dialogue box, select Trusted Locations. You will be presented with a list of the default trusted locations. These locations are critical for the proper operation of Excel add-ins, macros, and templates and should not be altered. Technically, you can save your workbook to one of Excel’s default locations, but it’s preferable to create your own.
  • Click Add a new location to set up your trusted location.

  • Do the following in the Microsoft Office Trusted Locations dialogue box:
    • Navigate to the folder you want to make a trusted location by clicking the Browse button.
    • Check the Subfolders of this location are also trusted box if you want any subfolder of the selected folder to be trusted as well.
    • Fill in the Description field with a brief message (this can help you manage multiple locations) or leave it blank.
    • Click the OK button.

Completed! You can now save your workbook with macros in a trusted location without worrying about Excel’s security settings.

How to Enable macros programmatically with VBA? 

Many people ask on Excel forums if it is possible to enable macros programmatically when opening a workbook and disable them before exiting. “No, it’s not possible,” is the immediate response. Because macro security is critical for Excel’s security, Microsoft designed any VBA code to be activated only by a user click.

When Microsoft closes a door, the user opens another 🙂 As a workaround, someone suggested using a “splash screen” or “instruction sheet” to force the user to enable macros. The fundamental concept is as follows:

You write code that generates all the worksheets except one, which is tucked away. The visible sheet (splash screen) states something like “Please enable macros and re-open the file” or provides more specific instructions.

When macros are disabled, the user can only see the “Splash Screen” worksheet; all other sheets are hidden. When macros are enabled, the code unhides all the sheets before re-hiding them completely when the workbook is closed.

How to Disable macros in Excel?

As previously stated, Excel’s default setting disables macros with a notification and allows users to enable them manually if desired. If you want to disable all macros silently, without receiving any notifications, go to the Trust Center and select the corresponding option (the first one).

  1. Click the File tab > Options in Excel.
  2. Select Trust Center from the left-hand pane, and then click Trust Center Settings.
  3. Select Macro Settings from the left menu, then Disable all macros without notification and click OK.

Понравилась статья? Поделить с друзьями:
  • Excel and dynamic range
  • Excel and descriptive statistics
  • Excel and database functions
  • Excel and creating macros
  • Excel and creating charts