美文网首页
error: enum user-defined type no

error: enum user-defined type no

作者: 神农架村姑 | 来源:发表于2019-10-15 10:56 被阅读0次
    sub ...()
      ...
    end sub
    
    Public Enum WorkDays
        Monday
        Tuesday
        Wednesday
        Thursday
        Friday
        Saturday
        Sunday
    End Enum
    
    Sub test()
        Dim wd As WorkDays
        wd = Monday
        Debug.Print wd
    End Sub
    

    运行时提示 compile error: user-defined type not defined
    编译时提示 compile error: Only comments may appear after end sub, end function and end property

    Solution:

    提示说只有注释能写在end后面,所以把定义枚举语句放到最开头所有sub之前就好了

    相关文章

      网友评论

          本文标题:error: enum user-defined type no

          本文链接:https://www.haomeiwen.com/subject/izwjmctx.html