VBA enums give occasional “Constant Expression Required” errors

后端 未结 5 1172
忘掉有多难
忘掉有多难 2020-12-16 11:41

I\'m using an enum defined in a class module in Excel VBA. This has been working fine, but I\'ve started getting a compile error on every time I do a comparison on enum vari

5条回答
  •  渐次进展
    2020-12-16 12:02

    Seems to be a bug.

    Copy the same module's code to a new one, and recompile. That seems to solve it for some.

    A similar fix exists, which involves editing and undoing on the enum definition's line.

    Consider switching to numeric constants if this is a frequent problem.

提交回复
热议问题