none
How to get the membername of an ENUM in VBA Script? RRS feed

  • Question

  • Hi all,

    I would like to get the membername of an Enum value as a string. This is no problem with VBA for Office in Visual Basic with [Enum].GetNames(..). But I could not find similar support in VBA scripting language.

    TIA.


    Regards Jörg

    Sunday, August 14, 2016 10:13 PM

All replies

  • [Enum].GetNames is not part of VBA. It is a method in VB.Net.

    Neither VBA nor VBScript have a method for getting the member names of an Enum. You could write a custom function for this purpose, but (a) you'd have to write a function for each Enum, and (b) you'd have to update the function yourself when you edit an Enum.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Monday, August 15, 2016 9:46 AM
  • I looked at this many years ago for column headings and I ended up using a data dictionary (hash).
    Monday, August 15, 2016 11:15 AM