本文转自:https://www.ablebits.com/office-addins-blog/2014/07/22/enable-macros-excel/#always-run-macros

This tutorial teaches how to enable macros in Excel 2010-2013. You'll also find step-by-step instructions showing how to disable macros in Excel or turn them on via Message bar and Backstage view. In addition you'll find a tip to run a macro even if all macros are disabled and get a link to a piece of code that gets users enable macros in a workbook.

First off, I'd like to share a brief intro to Excel macros and security risk linked to enabling them. A macro is a series of commands assembled together and designed to automate frequent routine tasks in Excel. You can run macros any time to perform certain actions.

Many macros are created using Visual Basic for Applications, or VBA. Lots of Excel users can record simple macros to streamline their work with spreadsheets. Developers create codes that are more complicated.

When enabling a macro in Excel that was written by someone else, you need to remember that it can carry a potential security risk. A person with malicious intent, like hacker, can make a destructive macro to spread a virus on your PC or network.

Read on to find detailed descriptions of macro settings, steps to enable Excel macros and save a macro-enabled workbook. You can also click any of the links below to get straight to the point.

How to enable macros in Excel from the Message Bar

If you open an Excel document that contains macros, you'll see the yellow Message Bar with a shield icon and the Enable Content button.

If you are sure, the macros are from a trustworthy source, just press the Enable Content button on the bar.


The file will be opened as a trusted document and the security warning will disappear.

Excel - enable macros via the Backstage view

You can also enable macros in Excel using the Microsoft Office Backstage view. You can see the yellow Message Bar if you click the File tab.

  1. Click on the File tab.
  2. You'll see the yellow Security Warning area. Click Enable Content.
  3. You will see 2 features: Enable All Content and Advanced Options. Select Enable All Content to always make the document's active content available.

The current Excel file will become a trusted document and all macros will be enabled.

How to always run macros for a trusted worksheet

If you create and share workbooks with macros you may want to avoid getting the security message every time. If you get all your workbooks only from reliable sources, you can choose to instantly run all macros for all publishers. Below you'll see how to enable all macros in Excel by default.

  1. Go to File -> Options -> Trust Center and press the Trust Center Settings ... button.

    Tip. You can also click on the Trust Center Settings link on the Security Warning.
  2. You will see the Trust Center window. Select the Macro Settings option.
  3. Select the radio button Enable all macros (not recommended, potentially dangerous code can run).

From now on all macros will run without warning.

Please note that this setting makes your computer open to viruses. You should be sure you get all workbooks with macros only from the trusted publishers.

Adjust macro settings on the Trust Center window

You can find all macro settings on the Trust Center window. These settings let you adjust the way you want to work with macro-enabled workbooks.

Follow the steps from How to always run macros for a trusted worksheet to get the Trust Center window.

Please see all the macro settings explained below:

  • Disable all macros without notification. Macros and security alerts regarding them get turned off.
  • Disable all macros with notification. If you select this radio button, macros will be disabled, but security alerts will appear if there are macros in a file. It lets you enable macros in Excel depending on the source.
  • Disable all macros except digitally signed macros. In this case, macros are turned off, security alerts appear and digitally signed by a trusted publisher macros run. If you have not trusted the publisher, you are offered to enable the signed macro and trust the publisher.
  • Enable all macros (not recommended, potentially dangerous code can run). All macros run without warning. Please note that this setting makes your computer open to viruses.
  • Trust access to the VBA project object model. This checkbox forbids or allows programmatic access to the Visual Basic for Applications (VBA) object model from an automation client. This security setting is for the code that computerizes an Office program and manipulates VBA environment and object model. For automation clients to access the VBA object model, the user running the code must grant access. You need to tick the check box to give access.

Run a macro even if all macros are disabled

Say the setting Disable all macros without notification is turned on your PC, but you need to run certain macro here and now. If you have Excel 2007-2013, you can enable macros even if your security settings don't allow this. The point is that Excel sees certain locations as trusted zones. This means if you store your macro-enabled files there, the security check can be omitted and the macro will run.

Please see the list of these trusted locations below:

Program Files\Microsoft Office\Templates

Program Files\Microsoft Office\Office12\Startup

Program Files\Microsoft Office\Office12\Library

Program Files\Microsoft Office\Office12\XLSTART

You can add any location on your PC to the trusted zone, by following the steps below:

  1. In Excel navigate to the File tab -> Options -> Trust Center -> Trust Center Settings -> Trusted Locations.
  2. Click on the Add new location button to see the Microsoft Office Trusted Location dialog box.
  3. Click Browse to search for the needed place on your PC.
Note. Before adding any location to trusted, make sure it's really safe since such location can be attacked by hackers.

How to save a macro in a workbook

Macros need you to save the files in a new macro-enabled workbook format. This type adds security warning to your file. If you don't choose the correcttype, the command will not be kept. Below you'll find how to save a macro-enabled Excel document:

  1. Navigate to File -> Save As and browse for the necessary location on your PC.
  2. Click on the Save as type: arrow and select the Excel Macro-Enabled Workbook from the list of types.
  3. Click Save to keep the results.

If you forget to select the type of Macro Enabled Workbook, you'll get a warning message notifying that the macro will not be saved:

Click No if you need to keep the macro.

How to disable macros in Excel 2010-2013

Suppose, you only proofread the files and don't need macros enabled on your PC. You get documents from various sources and prefer to set your security settings to the highest level. Since some macros can be potentially dangerous, you can disable them all using the Trust Center options.

  1. Follow the steps from How to always run macros for a trusted worksheet to get the Trust Center window.
  2. Select the Disable all macros without notification or Disable all macros with notification radio button. If you go for the first option, you will not know if there are any macros in the current file. The second button lets you identify Excel workbooks that contain macros.

Use special code to make users enable macros in a workbook

The code from this article forces a user to enable macros in a workbook. This code hides all sheets until the macro is enabled. It also adds a warning sheet that alerts the user to run macros. As soon as a user turns the commands on, the warning sheet is hidden and all other content is shown.

  1. Add the code to your workbook.
  2. Create a new sheet named "Warning".
  3. Add a message on the worksheet asking the user to re-open the workbook and enable macros.
  4. Finally, save your workbook.

You may also be interested in

Check out Tutorial with Excel examples about Macros for some nice and simple samples to automate your daily spreadsheet tasks.

If you are starting to learn macros, read How to insert and run VBA code in Excel - tutorial for beginners.

That's all about enabling and disabling macros in Excel. Hope you've found the information helpful. Feel free to leave your questions in the comments below. Be happy and excel in Excel!

[转]How to enable macros in Excel 2016, 2013, and 2010的更多相关文章

  1. Excel 2016 密码保护破解

    Excel 2016的密码保护可以区分为几个: 文件密码保护(Excel中叫做工作簿保护) 文件打开权限密码 文件修改权限密码 工作表保护 关于各个保护密码的设置方式请查阅其他资料,我的情况是之前自己 ...

  2. 关于Excel 2016 总要点击两次才能打开的解决方法

    1.快捷键:win+r,输入:regedit2.定位到如下项目“HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open\command”:3.编辑原有的内容,在最后添加 ...

  3. Excel 2016在大数据分析领域有了很多的改善

    Excel 2016在大数据分析领域有了很多的改善 通常,我们会把大数据分析的整个过程分为五个阶段: 获取获取,数据分析,可视化,发布报告,应用报告. 在获取数据方面,Excel 2016相对Exce ...

  4. Word、Excel、PPT 2016、2013、2010、2007 没有保存或断电导致文件丢失怎么恢复?

    1. 前言 没有保存文档还能恢复吗?死机.断电.蓝屏导致来不及保存文档,还能恢复吗?答案当然是可以的!Office中本身就有恢复文档的功能,可以帮助我们最大化的挽回损失. Office2013与Off ...

  5. Excel 2016 Power View选项卡不显示的问题

    https://zhuanlan.zhihu.com/p/43543442 PowerView是Excel中的Power系列插件之一,可以基于excel制作交互式仪表板. 初学者在使用Power Vi ...

  6. Excel 2016 for Mac

    1. Excel for Mac 的 Developer tab下没有XML组,因此无法从xml导入或者导出到xml: 2. Excel for Mac 中没有Mark as Finnal的功能: 3 ...

  7. 方法二:Excel 2016 VBA工程密码破解

    将你要破解的Excel文件关闭,切记一定要关闭呀!然后新建一个Excel文件 打开新建的这个Excel,按下alt+F11,打开vb界面,新建一个模块,如图所示 将代码复制到这个模块中,代码如下:Pr ...

  8. Excel 2016双击文件打开后是空白,再次双击才能打开(或者通过文件,打开才能打开)

    问题描述: 直接双击excel文件打开后是空白的,几乎所有功能都无法使用.但是再次双击该文件能够打开,或者通过文件 --> 打开的方式才能打开. 虽说能够打开文件,但是对于咱们这种追求完美的人来 ...

  9. excel 2016 for mac破解

    1: 首先去官网下载一个正版的: 2:再下载一个破解工具: 链接: http://pan.baidu.com/s/1i4AFHFf 密码: 3yf8 3:最后按照破解教程破解: http://jing ...

随机推荐

  1. python通过人脸识别全面分析好友,一起看透你的“朋友圈”

    微信:一个提供即时通讯服务的应用程序,更是一种生活方式,超过数十亿的使用者,越来越多的人选择使用它来沟通交流. 不知从何时起,我们的生活离不开微信,每天睁开眼的第一件事就是打开微信,关注着朋友圈里好友 ...

  2. 《老师说的都对》- Alpha冲刺阶段博客目录

    项目小组:<老师说的都对> 项目成员:孙浩杰,谭明耀,宋自康,孙肖肖,王明鑫,王观山 Github仓库地址-PCES 一.Scrum Meeting 第六周会议记录 第七周会议记录 二.测 ...

  3. Linux中防火墙命令

    #启动   systemctl start firewalld #开机启动   systemctl enable firewalld #停止   systemctl stop firewalld #禁 ...

  4. bayaim——听课笔记_01.Docker基础应用 10课.txt

    ===========2019年8月5日18:39:06====================10.20.100.21rootbayaim ==========01-Docker介绍======== ...

  5. Python活力练习Day3

    Day3:请输入星期几的第一个字母来判断是星期几,如果第一个字母一样,则继续判断第二个字母. #这是一道典型的题,一次输入一个字母,首字母匹配一个list里的内容.如果匹配到多个,再输入并匹配第二个字 ...

  6. IT兄弟连 HTML5教程 CSS3属性特效 CSS3背景

    CSS3规范中对背景这一部分,新加入了一些有用的功能,如可以设置多个背景图片.可以指定背景大小.设置背景渐变等功能.CSS3规范中定义的背景属性新增了background-clip.backgroun ...

  7. Java开发之使用websocket实现web客户端与服务器之间的实时通讯

    使用websocket实现web客户端与服务器之间的实时通讯.以下是个简单的demo. 前端页面 <%@ page language="java" contentType=& ...

  8. English: Class logogram

    IT # this is a IT type ISP ANOTHER # following is another logogram LCD PDA

  9. Android 极光IM-高级篇-玩聊天app诞生

    距离上一次写 基础篇有了4个月,终于我写了一个 功能完善的即时通讯app,作为高级篇的担当出现.废话不多说,上图 app预览 ​​​​ ​​​​ ​​ 实现功能 1.用户的登录注册 2.单聊,能清空聊 ...

  10. C语言入门-类型定义

    一.自定义数据类型(typedef) c语言提供一个叫做typedef的功能来声明一个已有的数据类型的新名字,比如: typedef int length; 这样length成为了int类型的别名 这 ...