Excel VBA 应用程序自发停止并显示消息“代码执行已停止"; [英] Excel VBA App stops spontaneously with message "Code execution has been halted"

查看:32
本文介绍了Excel VBA 应用程序自发停止并显示消息“代码执行已停止";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我在网上看到的情况来看,这是一个相当普遍的投诉,但答案似乎很少见.问题是这样的:

From what I can see on the web, this is a fairly common complaint, but answers seem to be rarer. The problem is this:

我们有许多 Excel VBA 应用程序,它们可以在许多用户的机器上完美运行.然而,在一台机器上,它们停在某些代码行上.它总是相同的台词,但这些台词之间似乎没有任何共同之处.

We have a number of Excel VBA apps which work perfectly on a number of users' machines. However on one machine they stop on certain lines of code. It is always the same lines, but those lines seem to have nothing in common with one another.

如果在暂停后按 F5(运行),应用程序将继续运行,因此几乎就像添加了一个断点.我们尝试从菜单中选择删除所有中断",甚至添加中断并再次将其删除.

If you press F5 (run) after the halt, the app continues, so it's almost like a break point has been added. We've tried selecting 'remove all breaks' from the menu and even adding a break and removing it again.

我们以前在单个应用程序中遇到过这个问题,我们通过从模块中删除代码、编译然后将其粘贴回来等方式解决"了这个问题.

We've had this issue with single apps before and we've 'bodged' it by cutting code out of modules, compiling and then pasting it back in etc.

问题现在似乎与 Excel 本身有关,而不是与单个 .xls 相关,因此我们有点不确定如何管理.

The problem now seems to relate to Excel itself rather than a single .xls, so we're a little unsure how to manage this.

如有任何帮助,我们将不胜感激:)

Any help would be gratefully received :)

谢谢,

菲利普·惠廷顿

推荐答案

我找到了第二个解决方案.

I have found a 2nd solution.

  1. 按调试"键弹出窗口中的按钮.
  2. Ctrl+Pause|Break 两次.
  3. 点击播放按钮继续.
  4. 完成后保存文件.

这篇关于Excel VBA 应用程序自发停止并显示消息“代码执行已停止";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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