Compile throws a “User-defined type not defined” error but does not go to the offending line of code

前端 未结 21 1286
再見小時候
再見小時候 2020-12-14 08:00

Symptoms

This is a symptom specifically when compiling an Excel VBA project. The following error occurs:

User-defined type not defin

21条回答
  •  南方客
    南方客 (楼主)
    2020-12-14 08:43

    I had this same problem when I inherited another analyst's workbook. He assigned macros to each button on his worksheet. When I changed the name of the module (not the procedure name), it kicked up this error. The fix was easy. Have the button run an _OnClick() event procedure in the worksheet and have that procedure explicitly Call MyProcedureName().

提交回复
热议问题