List of Cell Colors

I am currently working with a List that is full of color string names that can be used in the set range color activity, however I cannot use the values ​​in the list since being string I cannot use them in the activity instruction what I’m trying to do is something like Color.ColorList(0) can someone tell me how I can make this work considering that my list of colors are string values?

Hi @WSay

Try getting the variable type of the excel colours, and creating a list of them that way, you could cast your current string if that’s not possible.

Kind Regards

For a start have a look here getting all names from the KnownColor Enum:


And getting back the enum value for a string we can do:

 DirectCast(KnownColor.Parse(getType(KnownColor), "Purple"),KnownColor)
 DirectCast(KnownColor.Parse(getType(KnownColor), "Purple"),KnownColor).GetType

As an example


This helped me a lot, thank you very much!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.