Changing Configuration thru the api (ADDIN)

Solidworks crashes sometimes when an add in attempts changing the configuration

swmodel.showconfiguration (" SOME CONFIG")

any comments on how to address this problem

SolidworksApi macros