[转]How to enable macros in Excel 2016, 2013, and 2010
本文转自: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
- Excel - enable macros via the Backstage view
- How to always run macros for a trusted worksheet
- Adjust macro settings on the Trust Center window
- Run a macro even if all macros are disabled
- How to save a macro in a workbook
- How to disable macros in Excel 2010-2013
- Use special code to make users enable macros in a workbook
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.
- Click on the File tab.
- You'll see the yellow Security Warning area. Click Enable Content.
- 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.
- 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. - You will see the Trust Center window. Select the Macro Settings option.
- 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:
- In Excel navigate to the File tab -> Options -> Trust Center -> Trust Center Settings -> Trusted Locations.
- Click on the Add new location button to see the Microsoft Office Trusted Location dialog box.
- Click Browse to search for the needed place on your PC.
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:
- Navigate to File -> Save As and browse for the necessary location on your PC.
- Click on the Save as type: arrow and select the Excel Macro-Enabled Workbook from the list of types.
- 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.
- Follow the steps from How to always run macros for a trusted worksheet to get the Trust Center window.
- 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.
- Add the code to your workbook.
- Create a new sheet named "Warning".
- Add a message on the worksheet asking the user to re-open the workbook and enable macros.
- 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的更多相关文章
- Excel 2016 密码保护破解
Excel 2016的密码保护可以区分为几个: 文件密码保护(Excel中叫做工作簿保护) 文件打开权限密码 文件修改权限密码 工作表保护 关于各个保护密码的设置方式请查阅其他资料,我的情况是之前自己 ...
- 关于Excel 2016 总要点击两次才能打开的解决方法
1.快捷键:win+r,输入:regedit2.定位到如下项目“HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open\command”:3.编辑原有的内容,在最后添加 ...
- Excel 2016在大数据分析领域有了很多的改善
Excel 2016在大数据分析领域有了很多的改善 通常,我们会把大数据分析的整个过程分为五个阶段: 获取获取,数据分析,可视化,发布报告,应用报告. 在获取数据方面,Excel 2016相对Exce ...
- Word、Excel、PPT 2016、2013、2010、2007 没有保存或断电导致文件丢失怎么恢复?
1. 前言 没有保存文档还能恢复吗?死机.断电.蓝屏导致来不及保存文档,还能恢复吗?答案当然是可以的!Office中本身就有恢复文档的功能,可以帮助我们最大化的挽回损失. Office2013与Off ...
- Excel 2016 Power View选项卡不显示的问题
https://zhuanlan.zhihu.com/p/43543442 PowerView是Excel中的Power系列插件之一,可以基于excel制作交互式仪表板. 初学者在使用Power Vi ...
- Excel 2016 for Mac
1. Excel for Mac 的 Developer tab下没有XML组,因此无法从xml导入或者导出到xml: 2. Excel for Mac 中没有Mark as Finnal的功能: 3 ...
- 方法二:Excel 2016 VBA工程密码破解
将你要破解的Excel文件关闭,切记一定要关闭呀!然后新建一个Excel文件 打开新建的这个Excel,按下alt+F11,打开vb界面,新建一个模块,如图所示 将代码复制到这个模块中,代码如下:Pr ...
- Excel 2016双击文件打开后是空白,再次双击才能打开(或者通过文件,打开才能打开)
问题描述: 直接双击excel文件打开后是空白的,几乎所有功能都无法使用.但是再次双击该文件能够打开,或者通过文件 --> 打开的方式才能打开. 虽说能够打开文件,但是对于咱们这种追求完美的人来 ...
- excel 2016 for mac破解
1: 首先去官网下载一个正版的: 2:再下载一个破解工具: 链接: http://pan.baidu.com/s/1i4AFHFf 密码: 3yf8 3:最后按照破解教程破解: http://jing ...
随机推荐
- Hack the Breach 2.1 VM (CTF Challenge)
主机扫描: ╰─ nmap -p- -A 192.168.110.151Starting Nmap 7.70 ( https://nmap.org ) at 2019-08-29 09:48 CSTN ...
- 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构
目录 实现CentOS 7 编译安装基于 fastcgi 模式的多虚拟主机的wordpress和discuz的LAMP架构 准备环境: 准备软件版本: 主机名修改用以区分 数据库服务器 实现数据库二进 ...
- 信通院发布《云计算发展白皮书 (2019年) 》 (附PPT解读)
来源: 中国信息通信研究院CAICT 为了进一步促进云计算创新发展,建立云计算信任体系,规范云计算行业,促进市场发展,提升产业技术和服务水平.由中国信息通信研究院(以下简称“中国信通院”)主办,中国通 ...
- 使用SC命令操作(安装、开启、配置、关闭、删除)Windows下的服务
目录 一.直接使用cmd命令行操作windows服务 二.使用bat批处理-操作windows服务 一.直接使用cmd命令行操作windows服务 1.安装服务 sc create 服务名 binPa ...
- Prometheus学习系列(七)之Prometheus PromQL说明
前言 本文来自Prometheus官网手册1.2.3 和 Prometheus简介1.2.3 PromQL操作符 一.二元操作符 Prometheus的查询语言支持基本的逻辑运算和算术运算.对于两个瞬 ...
- Markdown: color list
Color name | hex character | Name AliceBlue #F0F8FF rgb(240, 248, 255) AntiqueWhite #FAEBD7 rgb(250, ...
- Android 下载进度对话框 ProgressDialog
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentV ...
- 如何在linux终端创建文件
我们都知道可以用mkdir命令创建一个新的目录,但更多时候如果能直接创建一个文件(普通文件)会让人感觉更愉悦:这样就可以不用在去打开一个专门的创建文本文件的软件,然后还要设置文件名,保存路径那样的繁琐 ...
- Centos8 配置静态IP
安装centos 8之后,重启启动网络时,会出现以下报错 报错信息如下: Failed to start network.service: Unit network.service not found ...
- Nginx + FastCGI + Django在windows上部署及nginx常用命令
一般应用都是部署在linux系统上,不会在windows上部署,emmm..所以有兴趣的就瞧瞧吧哈哈 nginx工作原理: nginx用于处理静态文件,动态部分经由fastcgi .scgi或uWSG ...