Thanks for the replies.
Using IfObject is an option which means I don't have to change the name in the script but it is not the full solution.
I still have the issue when mapping the name in the first instance, it will map it to one and not the other (because it does not exist). So I can map all the names (say they get mapped to CrownControls when mapping from the object browser) but then if at a later date the object browser does not 'see' CrownControls I then have to remap the objects to wndCrownControls. I don't know what causes the panel name as seen by test complete to change from time to time. Could it be my application causing this?