什么是自动运行在开放宏的好方法 [英] what is a good way to autorun macros upon open

查看:197
本文介绍了什么是自动运行在开放宏的好方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用code,很多网站都建议在打开一个Excel工作簿时自动运行宏的列表尝试。附件是我的VBA code上的ThisWorkbook:

I've tried using the code that many sites have suggested to autorun a list of macros upon opening an Excel workbook. Attached is my VBA code on ThisWorkbook:

Private Sub WorkbookOpen()


MsgBox "STOP!  Do NOT attempt to highlight any fields manually!" & vbCrLf & _
     "Any highlighting will be overwritten upon reentry of this workbook.", vbOKOnly     +vbExclamation

Call Melanoma.ReformatDeplete
Call Melanoma.CScheckNO
Call Melanoma.CScheckMissing
Call Glioma.ReformatDeplete
Call Glioma.ReformatGBM
Call Glioma.CScheckNO
Call Glioma.CScheckMissing
Call Breast.ReformatDeplete
Call Breast.CScheckNO
Call Breast.CScheckMissing
Call Lymphoma.ReformatDeplete
Call Lymphoma.CScheckNO
Call Lymphoma.CScheckMissing
Call Lung.ReformatDeplete
Call Lung.CScheckNO
Call Lung.CScheckMissing
Call Miscellaneous.ReformatDeplete
Call Miscellaneous.CScheckNO
Call Miscellaneous.CScheckMissing
Call Normals.ReformatDeplete
Call Normals.CScheckNO
Call Normals.CScheckMissing


End Sub

显然,我保存工作簿为2010启用宏的工作簿,但是当我打开工作簿,什么都不会发生在其上,我还是要点击VBA运行按钮

Obviously, I saved the workbook as a 2010 macro-enabled workbook, but when I open the workbook, nothing happens on its on, I still have to click the "run button" in VBA

有什么建议?

谢谢!

推荐答案

您比较接近,只是添加下划线

You are close, just add the underscore

Private Sub Workbook_Open()

这篇关于什么是自动运行在开放宏的好方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆