如何恢复此 VBA 项目? Excel 错误消息:“已删除部分:/xl/vbaProject.bin 部分。”

发布于 2024-10-19 07:25:05 字数 1104 浏览 1 评论 0原文

我在其他论坛上看到过有关此问题的相关帖子(请参阅:http://www .mrexcel.com/forum/showthread.php?t=372534),但我已经尝试了我发现的所有方法,但没有成功。

情况是这样的: 我有一个 .xlsm 工作簿(名为“PTPro.xlsm”),其中包含模块中大约 2000 多行 VBA 代码和 6-7 个大型用户窗体,每个窗体都有自己的巨大代码块。今天早些时候,我正在做这个项目,一切都很顺利。整个过程中我保存、关闭和打开该文件总共大约 20 次。我从来没有收到过错误消息。应该注意的是(如果这很重要的话)我是直接从 Excel 保存到闪存驱动器的。

今天晚上,当我把这个项目带回家时,我试图打开它进行快速更改。这时我收到了以下一系列错误消息:

  1. “Excel 在 'G:\PTPro\PTPro.xlsm' 中发现了无法读取的内容。是否要恢复此工作簿的内容?如果您信任此内容的来源工作簿,请单击“是”。"

  2. 单击“是”后,将打开一个新对话框,并显示以下错误消息:

  3. “Excel 能够通过修复来打开文件”或删除不可读的内容:/xl/vbaProject.bin 部分。(Visual Basic for Applications (VBA))"

  4. ​​

    此阶段我唯一的选择是单击“关闭”以加载工作簿。

  5. 当我按 Alt+F11 查看 VBA 编辑器时,整个 VBA 项目(模块、用户窗体、宏等)完全消失了!!!

我已按照我能找到的所有步骤进行操作,包括更改 Excel 默认值以启用所有宏并尝试在 4 台不同的计算机上打开该文件(从硬盘驱动器和闪存驱动器)。我能想到的唯一尚未尝试过的事情是在我今天使用的计算机上打开文件(顺便说一下,这是公共计算机实验室中的共享计算机)。直到周一才可以选择。

应该指出的是,有几个子工作簿包含我的应用程序所需的中间步骤,这些步骤在一天中也经常打开和关闭。他们都工作得很好。

如果您对这个问题有任何经验,或者对我如何恢复我编写的代码有任何想法,我将非常感激!

谢谢你!!!

I've seen related posts on other forums about this (see: http://www.mrexcel.com/forum/showthread.php?t=372534), but I've attempted everything that I've found with no success.

Here's the situation:
I have a .xlsm workbook (named 'PTPro.xlsm') that contains around 2000+ lines of VBA code in a Module and 6-7 large UserForms each with their own giant chunk of code. Earlier today, I was working on the project and everything was going just fine. I saved, closed, and opened the file about 20 times total throughout the process. Never once did I receive an error message. It should be noted (in case it's important) that I was saving directly to a flash drive from Excel.

When I brought the project home this evening, I attempted to open it to make a quick change. This is when I received the following series of error messages:

  1. "Excel found unreadable content in 'G:\PTPro\PTPro.xlsm'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes."

  2. After clicking yes, a new dialog box opens with the following error message:

  3. "Excel was able to open the file by repairing or removing the unreadable content. Removed Part: /xl/vbaProject.bin part. (Visual Basic for Applications (VBA))"

  4. My only option at this stage is to click 'Close' which loads the workbook.

  5. When I hit Alt+F11 to view the VBA editor, the entire VBA project (modules, userforms, macros, etc.) is COMPLETELY GONE!!!

I've followed all of the steps that I can find, including changing the Excel defaults to enable all macros and to tring to open the file on 4 different computers (both from the hard drive and from the flash drive). The only thing that I can think of that I haven't tried yet is opening the file on the computer that I was working on today (which is a shared computer in a public computer lab, by the way). This won't be an option until Monday.

It should be noted that there are several sub-workbooks that include intermediate steps required by my application that were opened and closed frequently throughout the day, as well. They are all working just fine.

If you have ANY experience with this problem, or ANY ideas as to how I might recover the code I've written, I would be EXTREMELY grateful!!!

THANK YOU!!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

明月松间行 2024-10-26 07:25:06

问题是因为客户端电脑未安装 Microsoft Office
Visual Basic 应用程序

正确答案。
在设置菜单中的Office 工具类别中选择从我的计算机运行全部内容

开发人员...找到更好的错误消息就这么难吗?

The problem is because the client PC doesn't install Microsoft Office
Visual Basic Application

Right answer.
Select Run all from my computer for the Office Tools category in setup menu.

Developers... Was it so hard to find a better error message ?

变身佩奇 2024-10-26 07:25:06

我朋友说你修改了注册表编辑器HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\VBAOff。在“数值数据”框中,将 1 更改为 0 或按删除键(单击鼠标右键,然后单击“删除”)。
退出注册表编辑器。

My friend said that you have change in Registry Editor HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\14.0\Common\VBAOff. In the "Value data" box, make the change from 1 to 0 or press the delete key (click the right mouse button and click Delete).
Exit Registry Editor.

难如初 2024-10-26 07:25:06

!我必须为我的 xlsm 文件解决这个问题!

VBA代码是在我的Mac上编写的,我(因为我来自德国)在一些用户表单名称中放置了一些“䔓ö”和“ü”(如此特殊的符号)。
现在 Windows 上的 Excel 2010 无法读取这些标志,并且文件已损坏。
解决方案:我已将所有特殊符号(如“ä”、“ß”、“ü”等)替换为标准符号,瞧 ->一切都很好。

希望这对您有帮助,就像它对我现在有帮助一样!

对于如此愚蠢的错误和操作系统之间的这种不一致,我真的不得不大笑。

! i got to solve this problem for my xlsm-files !

the VBA-code was written on my mac an there i (since i am from Germany) put some "ä" "ö" and "ü" (so special signs) in some of the Userform-names.
Now the Excel 2010 on Windows could not read these signs and the file got corrupted.
Solvation: i have replaced all special signs (like "ä", "ß", "ü", ...) with standard ones and e voila -> everything worked fine.

Hope this helps you as it helps me right now!

I had really had to laugh hard about such an dumb bug and this inconsistency between the OS.

叫思念不要吵 2024-10-26 07:25:06

检查您电脑上的语言设置是否与运行宏所需的语言设置相同。

宏中可能写入了特殊字符,因此您的 PC 的主要输入语言应与 Micro 相同。

就我而言,宏是在日本编写的,其中日语字符很少,我的电脑的主要输入语言是英语(印度)。删除它并只保留日语解决了我的问题。

Check if the Language settings on your pc are the same required for running macro.

Macro might have special characters written in it and thus the primary input language of your PC should the same as that of Micro.

In my case macro was written in Japan having few Japanese characters in it and primary input language of my PC was English (India). Removing it and keeping only Japanese solved my problem.

牵你手 2024-10-26 07:25:05

当我尝试在客户端 PC 中运行 VBA 脚本时,我遇到类似的问题。

问题是因为客户端 PC 未安装 Microsoft Office Visual Basic 应用程序。通过运行office setup然后添加Visual Basic Application Feature,脚本成功运行。

I have similar problem when i try to run my VBA script inside client PC.

The problem is because the client PC doesn't install Microsoft Office Visual Basic Application. By running office setup then add Visual Basic Application Feature, the script successfully running.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文