Is there a way to get the enums in VBA? Something like this example for C#, but for VBA?
using System;
class EnumsExampleZ
{
private enum SiteNames
There is no built-in function, though it is easy enough to roll your own in a concrete case:
Enum FruitType
Apple = 1
Orange = 2
Plum = 3
End Enum
Function EnumName(i As Long) As String
EnumName = Array("Apple","Orange","Plum")(i-1)
End Function
If you have several different enums, you could add a parameter which is the string name of the enum and Select Case
on it.
Having said all this, it might possible to do something with scripting the VBA editor, though it is unlikely to be worth it (IMHO).