Can't enter break mode at this time

后端 未结 4 1056
花落未央
花落未央 2021-01-15 03:04

This has been happening increasingly, when I have a sheets.add or sheets.delete in excel VBA. After searching and searching I finally found the official Microsoft support pa

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-15 03:25

    Yet another Excel/VBA glitch.

    When it happens to me when I click a button running a macro:

    • I first try to directly run the macro from VBE,
    • if it fails, then I put a breakpoint at the first instruction of the macro,
    • if it still fails, I try both,
    • or, after clicking the button and breaking on the first breakpoint, I do a single step (SHIFT F8) and then I can let debug run freely as usual (F5).

    And so far I don't get this error anymore.

    Probably not foolproof either but worth a try.

提交回复
热议问题