CompConfigProperties5 doesn't work for all configurations and display states

Hi All,

For some reason, i need to create a macro which will select specific components of an assembly (based on their names), envelope them and hide them for all configurations and display states of the assembly. I am using AssemblyDoc::CompConfigProperties5 to achieve it; but it works only for active configuration and display state. Am i missing something or there is any other method to do this?

In short, i want to automate this:

Thanks in advance

SolidworksApi/macros