alt+F11 进入vba界面,F5运行macro后报错。

Sub 合并当前工作簿下的所有工作表()
Application.ScreenUpdating = False
For j = 1 To Sheets.Count
If Sheets(j).Name <> ActiveSheet.Name Then
X = Range("A65536").End(xlUp).Row + 1
Sheets(j).UsedRange.Copy Cells(X, 1)
End If
Next
Range("B1").Select
Application.ScreenUpdating = True
MsgBox "当前工作簿下的全部工作表已经合并完毕!", vbInformation, "ATTENTION!"
End Sub

error: the macros in this project are disabled, please refer to the online help or documentation of the host application to determine how to enable macros.

Solution 1: 检查安全中心的设置。

Enable VBA macros is "checked".

Solution 2:

看看macro书不是创建在了正确的Excel object下,有时候打开太多excel。默认按ALT+F11会在其他excel object下创建macro。

在对应的object下创建新的module,然后输入代码。Function + F5运行。成功!

Excel error - the macros in this project are disabled, please refer to the online help or documentation of the host application to determine how to enable macros.的更多相关文章

  1. [转]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 T ...

  2. Eclipse无法启动报An internal error occurred during: "reload maven project". java.lang.NullPointerException

    由于没有正常关机导致eclipse无法将数据正常写入配置文件导致无法启动.报这样一个异常 An internal error occurred during: "reload maven p ...

  3. ERROR: Cannot change version of project facet Dynamic Web Module to 3.0?

    Issue: When you create web app in eclipse with maven configuration, you may get following error. Can ...

  4. 解决 React-Native mac 运行报错 error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by ope

    React-Native 开发的项目,Android 方面没有任何问题,IOS 就是无法跑起来,报错信息如下: mac 10.14.4 xcode 10.2.1 error Failed to bui ...

  5. error MSB8031: Building an MFC project for a non-Unicode character set is deprecated

    vs2013编译VC++源码,错误: error MSB8031: Building an MFC project for a non-Unicode character set is depreca ...

  6. error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library. See http://go.microsoft.co

    Win10,也重新装了免费版的Visual Studio 2013 y,写MFC程序时候发现这样的提示: error MSB8031: Building an MFC project for a no ...

  7. 关于Error:Maven Resources Compiler: Maven project configuration required for module '项目名' isn't available. Compilation of Maven projects is supported only&

    总是出现Error:Maven Resources Compiler: Maven project configuration required for module '项目名' isn't avai ...

  8. (转)新建maven项目时报错Error:Maven Resources Compiler: Maven project configuration required for module 'XX'解决方法

    转载地址:https://blog.csdn.net/qq784515681/article/details/85070195 在新建maven项目时,Problems中报错: Error:Maven ...

  9. eclipse不能启动,An internal error occurred during: "reload maven project".

    An internal error occurred during: "reload maven project". 这个错误是因为项目已经关闭,导致 导致此问题的原因是Sprin ...

  10. An internal error occurred during: “Updating Maven Project”. Unsupported IClasspathEntry kind=4解决办法

    An internal error occurred during: "Updating Maven Project". Unsupported IClasspathEntry k ...

随机推荐

  1. node.js 历史版本下载

    https://nodejs.org/zh-cn/download/releases/

  2. 前端随笔0:URL与状态的双向绑定

    记录一些最近写前端的思考总结,也算是给自己的技术随笔开个篇 在接触以 React,Vue 为代表的工程化前端框架前,我还是一个拿着 jQuery 手撸特效和手写 CSS 的切图仔,捣鼓 Vue 时接触 ...

  3. Java第四讲动手动脑

    1. 在以上的代码中,main方法调用的是public void println(Object x),这一方法调用了String类的valueOf方法,valueOf方法内部调用Object. toS ...

  4. 普冉PY32系列(六) 通过I2C接口驱动PCF8574扩展的1602LCD

    目录 普冉PY32系列(一) PY32F0系列32位Cortex M0+ MCU简介 普冉PY32系列(二) Ubuntu GCC Toolchain和VSCode开发环境 普冉PY32系列(三) P ...

  5. 原创如何给MDK5.37添加Arm Compiler 5

    最新发布的MDK5.37已经不再安装Arm Compiler 5(ARMCC)编译器了,因为点击魔术棒后,在Target选项卡中选择编译器时,会看到missing:compiler version 5 ...

  6. 微信小程序(开发某些方式)

    1.开发工具:微信小程序开发工具(需要appid登录)2.调试:可使用微信开发者工具预览(用真机测试)3.真机调试:微信开发者工具真机调试(可打印以及查看网络等)4.扫一扫功能:   1.小程序里面可 ...

  7. pgsql计算占比

    SELECT len/sum(len)over(partition by road_id) param from road_jcpd_section

  8. java 将yyyyMMddHHmmss转化为yyyy-MM-dd HH:mm:ss格式的字符串

    思路很简单:先转化为yyyyMMddHHmmss格式的Date类型,再格式化为yyyy-MM-dd HH:mm:ss格式的字符串类型 import java.text.DateFormat; impo ...

  9. python运行脚本报错Non-UTF-8

    写完脚本运行报:SyntaxError: Non-UTF-8 code starting with '\xa1' in file/createuser/test.py on line 1, but n ...

  10. Win10删除此电脑默认的7个文件夹

    删除方法 用记事本拷贝以下内容,改文件后缀为reg,然后点击执行. Windows Registry Editor Version 5.00 ;如需还原去除上语句前减号即可 ;取消我的电脑" ...