[转]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 ...
随机推荐
- JS获取包含当前节点本身的代码内容(outerHtml)
原生JS DOM的内置属性 outerHTML 可用来获取当前节点的html代码(包含当前节点),且此属性可使用jQuery的prop()获取 <div id="demo-test-0 ...
- Neo4j安装过程详解
在安装neo4j之前,需要安装Java JRE,并配置Java开发环境,然后安装neo4j服务. 一.CentOS下安装 1.下载Neo4j 去官网下载最新的neo4j,选择社区版.地址:https: ...
- electron初探问题总结
使用electron时间不是很久,随着使用的深入慢慢的也遇到一些问题,下面总结一下遇到的问题与大家分享,避免趟坑. 主要问题汇总如下: webview与渲染进程renderer间通信 BrowserW ...
- java之不同数据流应用举例
按操作单位的不同分为:字节流(8bit)(InputStream.OuputStream).字符流(16bit)(Reader.Writer) 按数据流的流向不同分为:输入流.输出流 按角色的不同分为 ...
- C++之typename和typedef关键字
1. typename的作用 template <typename Distance> class KDTreeIndex : public NNIndex<Distance> ...
- Python 中国象棋源码 V1
Pygame 做的中国象棋,一直以来喜欢下象棋,写了 python 就拿来做一个试试,水平有限,电脑走法水平低,需要在下次版本中更新电脑走法,希望源码能帮助大家更好的学习 python.总共分为四个文 ...
- VUE+Element UI实现简单的表格行内编辑效果
原理是通过Css控制绑定的输入控件与显示值,在选中行样式下对控件进行隐藏或显示 <!DOCTYPE html> <html> <head> <meta cha ...
- 精通awk系列(7):awk读取行的细节
回到: Linux系列文章 Shell系列文章 Awk系列文章 详细分析awk如何读取文件 awk读取输入文件时,每次读取一条记录(record)(默认情况下按行读取,所以此时记录就是行).每读取一条 ...
- C# 中的基本数值类型
在之前的文章中(地址:https://www.vinanysoft.com/c-sharp-basics/introducing/),以 HelloWorld 程序为基础,介绍 C# 语言.它的结构. ...
- pandas 初识(六)-可视化
Pandas 在一张图中绘制多条线 import pandas as pd import numpy as npimport matplotlib.pyplot as plt df = pd.Data ...