Why MS Excel crashes and closes during Worksheet_Change Sub procedure?

前端 未结 3 1443
暗喜
暗喜 2020-11-21 04:45

I am having a problem with Excel crashing, when I run VBA code on an excel sheet.
I\'m trying to add the following formula on worksheet change:

Private S         


        
3条回答
  •  忘掉有多难
    2020-11-21 05:23

    Excel was crashing, not the VBA function.
    The events were not disabled and the call stack was filled by an infinite loop of OnChange events.
    A little advice that helps finding this type of errors: set a breakpoint on the first line of the event, then execute it step by step pressing F8.

提交回复
热议问题