How to loop through all the properties of a class?
Use Reflection: Type type = obj.GetType(); PropertyInfo[] properties = type.GetProperties(); foreach (PropertyInfo property in properties) { Console.WriteLine(“Name: ” + property.Name + “, Value: ” + property.GetValue(obj, null)); } for Excel – what tools/reference item must be added to gain access to BindingFlags, as there is no “System.Reflection” entry in the list Edit: You can also … Read more