excel VBA break execution when there's no brea

2020-06-30 05:10发布

I'm just noticing that on my laptop (Dell XPS 15z) there's no BREAK key (no dedicated number keypad). I'm running the debugger step-by-step and then when all seems fine, I just let it play out. However, it's running in an infinite loop and now I'm realizing there's no way to stop it without the break key!!!!

Is this a bad joke? I had to reboot the computer; is there a more graceful way??

Thanks.

12条回答
别忘想泡老子
2楼-- · 2020-06-30 05:38

I have a Japanese Layout keyboard. I neither have a scroll lock nor a break on my laptop-Lenovo E470. A long press on the Esc key worked as a terminator for me.

查看更多
爷的心禁止访问
3楼-- · 2020-06-30 05:40

On my Dell at least : ctrl + alt + esc BEFORE your cursor starts looping itself

I got this info from aidangrogan on this website :

http://en.community.dell.com/support-forums/laptop/f/3518/t/19355018

So I don't claim to have found it myself. All credits to him (or her)

查看更多
爷、活的狠高调
4楼-- · 2020-06-30 05:42

just press the escape key twice ;-)

查看更多
Luminary・发光体
5楼-- · 2020-06-30 05:43

Despite this being an old question, I have just encountered the same issue and discovered that Ctrl+Scroll lock works as a break.

"Scroll lock" can be accessed on my DELL Laptop via the blue function key "Fn" and the "F6" key which has a small blue lock symbol on it with an ⇳ symbol in it. At other computers it may look like ⤓ . So effectively I press Ctrl+Fn+F6.

查看更多
够拽才男人
6楼-- · 2020-06-30 05:43

Hold CTRL+Fn & hit Shift - Stopped my macro from running. I don't have a 'Break' key either on the keyboard of my HP Pavilion G7.

查看更多
神经病院院长
7楼-- · 2020-06-30 05:43

I found this thread and saw the solution that has the most votes, but then realized my laptop has no Pause, Break or ScrLk) keys. I tried other proposed solutions, like 'OnScreen Keyboard' or alternative key combinations, but those didn't work either.

Then it hit me: if it's a phantom break point associated with particular line(s) of code, why not just get rid of the line(s)?

So that's what I did:

  1. I cut the line(s) where execution was breaking.
  2. Ran the macro again (it didn't break this time)
  3. Pasted the line(s) again.

It worked for me, when no other key combination (onscreen or physical) worked. Hope it helps someone!

查看更多
登录 后发表回答