Hi,
This is not a question but a post to let the community know there is a bug with Enumerations in VBA. This information is not new and may be common knowledge.
Usually these are experienced by a rather annoying "Constant Expression Required" when executing code using Enums. Code that has executed properly one minute, may not the next. My personal case was when passing enumerations as function arguments.
Public Enum Fruits
Apple
Orange
Grape
End Enum
Public Function EnumsAreBuggy(fruitname as Fruits)
End Function
Some claim restarting the application or event a reboot is required to remedy the issue. Personally, I recommend not wasting your time and sacrificing the integrity of your application with Enumerations. Perhaps consider using UDTs instead. Hope this is helpful to someone.
Below are resources that describe this behavior:
https://stackoverflow.com/questions/...equired-errors
https://www.tek-tips.com/viewthread.cfm?qid=1355882
Bookmarks