进入F8的Excel VBA问题

After you record or write a macro in Excel, you can run the macro, or go slowly through it, line by line, to see if it is working correctly. I use the F8 key, in the Visual Basic Editor, if I’m troubleshooting a macro, to see where something is going wrong. You can use also use the Step Into command, in the VBE’s Debug menu.

在Excel中记录或编写宏之后,您可以运行该宏,或逐行缓慢浏览该宏,以查看其是否正常运行。 如果要对宏进行故障排除,请在Visual Basic编辑器中使用F8键,以查看问题出在哪里。 您还可以使用VBE的“调试”菜单中的“进入”命令。

f8problemfix04

However, for the past few months, something was going wrong with the “Step Into” command in Excel 2010, whether I used the menu, or the F8 key.

但是,在过去的几个月中,无论我使用菜单还是F8键,Excel 2010中的“逐步进入”命令都出了问题。

代码不会停止 (Code Doesn’t Stop)

In some macros, especially if the code opened another Excel file, when I pressed the F8 key, the code ran to the end of the macro, instead of stopping at the next line of code. That made it very difficult to troubleshoot the code!

在某些宏中,尤其是如果代码打开了另一个Excel文件,当我按F8键时,代码将运行到宏的末尾,而不是在下一行代码处停止。 这使得对代码进行故障排除非常困难!

It could also cause other inconvenient or embarrassing problems, if the macro was designed to update files, or send out emails. You don’t want that kind of thing happening at the wrong time.

如果宏被设计为更新文件或发送电子邮件,它还可能导致其他不便或尴尬的问题。 您不希望这种事情在错误的时间发生。

As a workaround, I could add breakpoints in the code, and it would stop there. Unfortunately, I didn’t always know when the F8 problem might occur, so I didn’t add the breakpoints in every procedure, before trying to step through it.

作为一种解决方法,我可以在代码中添加断点,并且它将在此处停止。 不幸的是,我并不总是知道何时可能发生F8问题,因此在尝试逐步解决问题之前,我没有在每个过程中都添加断点。

I searched Google, to see if anyone had a solution for the “F8 runs to the end of the macro” problem, but couldn’t find anything. There were other people complaining about the same thing, but nothing to fix the problem.

我搜索了Google,看是否有人可以解决“ F8运行到宏末尾”的问题,但找不到任何东西。 还有其他人抱怨同样的事情,但没有解决这个问题的方法。

终于找到了解决方案 (Finally a Solution Found)

Finally, my friend, Ross Connell, found a solution last week, and kindly shared it with me. Ross spent a long time communicating with Microsoft’s tech support, about this and a couple of other issues, and someone there suggested this fix.

最后,我的朋友罗斯·康奈尔(Ross Connell)上周找到了解决方案,并与我分享了该解决方案。 罗斯花了很长时间与Microsoft的技术支持人员就此问题以及其他一些问题进行了交流,有人建议使用此修复程序。

The suggestion is not documented on the Microsoft website though, so don’t take this as an official recommendation from them. However, making this change fixed the problem for me, and for Ross. If you’re comfortable in making a change to your Windows Registry, you can try it too, at your own risk.

但是,该建议未在Microsoft网站上记录,因此请勿将其作为官方建议。 但是,进行此更改对我和罗斯都解决了问题。 如果您愿意对Windows注册表进行更改,也可以尝试尝试,但后果自负。

更改注册表 (Change the Registry)

To fix this problem, you can add a new DWORD in the Registry. It’s easy to do, but as always, when working in the Registry, be careful!

若要解决此问题,您可以在注册表中添加一个新的DWORD。 这很容易做到,但是和往常一样,在注册表中工作时要当心!

I’ve outlined the steps on my website, and you can see the details here. Read the warnings carefully – you can mess things up if you aren’t careful when making a change in the Windows Registry.

我已经在网站上概述了步骤,您可以在此处查看详细信息 。 请仔细阅读警告-如果在Windows注册表中进行更改时不小心,可能会搞砸。

On my computer, I’ve got 32-bit Office installed, on a 64-bit system, and below is a screen shot of the DWORD as I added it.

在我的计算机上,我安装了32位Office,在64位系统上,下面是我添加DWORD的屏幕截图。

If you had the F8 problem, and tried this solution, please let me know your results, in the comments. Thanks!

如果您遇到F8问题,并尝试了此解决方案,请在评论中让我知道您的结果。 谢谢!

f8problemfix02

翻译自: https://contexturesblog.com/archives/2014/09/04/excel-vba-problem-with-step-into-f8/

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
点点多人视频空间是dd5588推出的集视频聊天、游戏、远程会议,互动娱乐与一体的大型综合娱乐平台。平台汇聚大量网络明星、歌手和美女主持,更带来互动交友和视频游戏功能,给所有的网友们带来网络K歌,飚歌,游戏,会议,交友的全新网络生活。   9.1版本更新说明:   1、新增数款休闲游戏。   2、更换音视频流解码,不降低音质,网络更通畅。   3、增加添加区长,副区长模块。   4、完整查询个人所有礼品流水,房间人气功能。   5、多麦序功能,掉线后自动恢复麦序。   6、增加座驾功能。   视频窗口可以运用各种虚拟视频的特效功能让呈现效果变得更加炫目。      双线互通让聊天畅通无阻二视频房间全部为双线互通,即网通电信互联互通,让用户体验沟通中的绝对“零”距离。   核心功能:   免费多方视频聊天娱乐免费高清晰全视频、全音频沟通,随时随地畅聊无限,可随时邀请好友进行点对点聊天或进入聊天室交流。   多人同时语音,网络party,声色共享,好友沟通绝对“零”距离,不被打扰的私密空间。   多人视频聊天室精彩不断,两路视频、语音,排麦及主持机制,优质的立体声音频效果,更有300人容量的视频群体娱乐大舞台。   最生动的虚拟礼物轻松点击即可赠送好友,传情达意尽享交友乐趣。   视频休闲游戏乐趣无穷点点聊天室客户端面板可直接点击进入游戏大厅登陆面板,多种棋牌娱乐游戏供您选择;可以视频语音的休闲游戏,体会面对面的游戏快感。   超级交友平台,让您即时体验粉红男女浪漫遭遇的感觉。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值