简体   繁体   English

Excel 工作簿模块未出现在工作簿宏中

[英]Excel Workbook Modules Not Appearing in Workbook Macros

I have a macro-enabled workbook which contains several modules, each module containing a number of macros.我有一个启用宏的工作簿,其中包含多个模块,每个模块都包含许多宏。 My issue is that I open the macro list from the developer tab and no macros for my workbook are there anymore.我的问题是我从开发人员选项卡中打开了宏列表,并且我的工作簿没有宏了。 When I open VBA, I still see them there and associated in the tree to the workbook/project.当我打开 VBA 时,我仍然在那里看到它们并在树中与工作簿/项目相关联。 The macros are still in the modules as well.宏也仍在模块中。

Background: Today, after a bit of editing in one of the macros, I closed VBA, got a prompt about a project being reset, I clicked ok.背景:今天,在对其中一个宏进行了一些编辑后,我关闭了 VBA,收到有关正在重置项目的提示,我单击确定。 Problems began.问题开始了。 All macros in the workbook used to show up from the macros prompt in the developer tab.工作簿中的所有宏过去都是从开发人员选项卡中的宏提示中显示的。

Project/Workbook tree with associated modules containing macros;带有包含宏的相关模块的项目/工作簿树; no macros showing in workbook工作簿中没有显示宏

I think I realized what the problem was.我想我意识到了问题所在。 I was having an issue with running a macro to which I decided to recover an earlier version of the workbook and saved over the original.我在运行宏时遇到问题,我决定恢复工作簿的早期版本并保存在原始版本上。 Well, the macros were still hyperlinked to the recovered version of the workbook that had the name extension that included the date/time, therefore "belonging" to that workbook.好吧,宏仍然超链接到具有包含日期/时间的扩展名的工作簿的恢复版本,因此“属于”该工作簿。

My fix: I right clicked the macroed object (button), assign macro, and deleted the hyperlink text and kept only the name of the macro.我的修复:我右键单击宏 object(按钮),分配宏,并删除超链接文本,只保留宏的名称。 One by one, all macros were recovered to the workbook.一个接一个,所有的宏都恢复到了工作簿中。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM