打开时,PowerPoint 2007/2010 VBA ppam 加载项不会显示在 VBA 编辑器中
我在模块中创建了 PowerPoint 2007/2010 VBA 插件 (.ppam) 的一些代码。我还添加了一个 XML 功能区(这并不重要,但它向我显示该文件实际上已在 PowerPoint 中打开)。我可以单击我创建的功能区中的一个按钮,它将执行我的模块中的代码。凉爽的。
当我打开 VBA 编辑器 (ctrl + F11) 时,加载项不显示。事实上,如果我没有打开另一个文档,我什至无法打开编辑器。我已在 PowerPoint 2007 和 2010 中尝试过此操作。
如何编辑已创建的 PowerPoint 加载项的代码?我在 Excel 中制作了许多 VBA 插件,但也许 PowerPoint 有所不同(我疯了吗)?
I've created a PowerPoint 2007/2010 VBA Add-In (.ppam) some code in a module. I've also added an XML ribbon (not important, but it shows me that the file is in fact open in PowerPoint). I can click a button in the ribbon I created and it will execute code from my module. cool.
When I open the VBA editor (ctrl + F11), the Add-In does not show up. In fact, if I don't have another document open I can't even open the editor. I've tried this in PowerPoint 2007 and 2010.
How can I edit the code of a PowerPoint Add-In I've already created? I've made many VBA Add-Ins in Excel, but maybe PowerPoint is different (am I crazy)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然迟到了,但为了完整起见,人们可能还想了解另一个非常有用的技巧。
HKCU\Software\Microsoft\Office\xx.0\PowerPoint\Options
(其中 xx.0 对于 Office 2003 为 11.0、对于 Office 2007 为 12.0、对于 Office 2010 为 14.0)
DebugAddins
和DWORD=1
插件现在将出现在 IDE 中;您可以修改它们、运行它们、测试它们,基本上可以执行除保存之外的任何操作,因此在调试代码后,导出您更改的任何模块/表单/类,以便您可以将它们导入到包含代码的 PPT/PPTM 中并再次另存为加载项。
这可以节省数小时的调试乏味/时间。
Late to the party here, but for the sake of completeness, there's one other very useful trick people might want to be aware of.
HKCU\Software\Microsoft\Office\xx.0\PowerPoint\Options
(where xx.0 is 11.0 for Office 2003, 12.0 for Office 2007, 14.0 for Office 2010)
DebugAddins
aDWORD=1
Add-ins will now appear in the IDE; you can modify them, run them, test them, basically do anything but SAVE them, so after your code is debugged, export any modules/forms/classes you've changed so you can import them into the PPT/PPTM that contains your code and save as add-in again.
This can save hours of debugging tedium/time.
您不能直接编辑 .ppam,因为它是“已编译”的。执行此操作的方法是将所有代码/自定义保存在 .pptm 中(并确保将该 .pptm 保留为 .pptm),并且当您想将其作为加载项进行测试时,请执行“另存为.. " 到 .ppam,然后加载它。不满意吗?返回您的 .pptm 并在那里进行更改。
顺便说一句,如果您不想使用功能区只是为了确保它已作为加载项加载,只需使用 AutoOpen 宏(在任何模块中),例如:
一旦您满意,您可以稍后删除该 AutoOpen 宏与您的加载项。
You cannot directly edit a .ppam as it is sort of "compiled". The way to do this is maintain all your code/customizations in a .pptm (and make sure you keep that .pptm as a .pptm) and when you want to test it as an add-in, do a "Save As.." to a .ppam and then load it. Not happy with it? Go back to your .pptm and make the changes there.
BTW, if you don't want to use the Ribbon just to ensure it has loaded as an add-in, just use an AutoOpen macro (in any module), like:
You can remove that AutoOpen macro later, once you're satisfied with your add-in.