MS Project 2010 - 如何从(损坏?)Global.MPT 恢复宏
我一天内开发了一些 VBA 宏 - 500 行代码。代码被放入 Global.mpt 中,因为我要在不同的项目文件中重用它。
在某个时刻,我错过了 while 循环中的增量循环。调试时,这会使 MS Project 陷入无响应的 100% CPU 使用率循环。我不得不从任务管理器中终止 MS Project,重新启动后我在 Global.mpt 中看到没有 VBA 模块。我在现有 Global.MPT 中看到变量和过程的名称,但没有可手动恢复的纯代码。
当我尝试将 Global.MPT 重命名为 MyGlobal.MPT 并打开它时,MS Project 显示“组织器”对话框,建议将内容从 MyGlobal.MPT 导入到 Global.MPT,但“模块”选项卡显示空列表,就像没有任何可导入的内容一样。
有没有办法修复或导出文件中的 VBA 内容?我不想浪费一天的工作:(
i was developing some VBA macro during a day - 500 lines of code. Code was placed into Global.mpt because i was going to reuse it across different project files.
At some moment i missed to increment cycle in the while cycle. When debugging this brought MS Project into endless non-responsive 100%-CPU-usage loop. I had to kill MS Project from task manager and after restarting it i see no VBA modules in Global.mpt. I see names of my variables and procedures in existing Global.MPT, but there is no plain code to restore manually.
When i try renaming Global.MPT into MyGlobal.MPT and opening it, MS Project shows 'Organizer' dialog suggesting to import content from MyGlobal.MPT to Global.MPT but 'Modules' tab shows empty list of like there is nothing to import.
Is there way to fix or export VBA content from the file? I do not want to loose day of works :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
供参考 - 名为 MyModule 的模块,具有以下内容
看起来像 VBA 流中的以下内容
For referrence - module named MyModule with following content
Looks like following in the VBA stream
其他解决方案是从备份中恢复。使用 Project 在另一台计算机上打开或修复用户配置文件。它可能已腐败。如果您可以使用其他用户名登录电脑并尝试打开该文件。祝你好运,
或者:
1] 获取文件 -->选项 -->信任中心-->点击信任中心设置-->选择选项“允许加载旧版或非默认文件格式的文件”并尝试打开该文件。
2]打开一个空白项目并尝试插入有问题的文件并尝试打开它。
Other solutions are to recover from backup. Open on another machine with Project or repair the User Profile. It may be corrupt. If you can log in with another username to the PC and try to open the file. Good luck,
OR:
1] Go t File --> Options --> Trust Center --> click on Trust Center Settings --> Select the option "Allow loading files with legacy or non-default file formats" and try opening the file.
2] Open a blank project and try inserting the problematic file and try opening it.
最简单的方法是将文件扩展名更改为 MPP 并将其作为项目打开。组织者会出现并询问您是否要将 MPP 的宏和代码复制到新的(空白)MPT 文件中。只需将它们滑过,您就可以了(您必须重置您的参考资料,但除此之外,准备好开始)
The easiest way is to simply change the file extension to MPP and open it as a project. The organizer will come up and ask you if you want to copy the MPP's macros and code into your new (blank) MPT file. Just slide them over and you're good as gold (you'll have to reset your references, but otherwise, ready to go)