>Not to be a PITA but, in addition to the above, you should check whether otoolbar is an object using PEMSTATUS(oapp,'otoolbar',3). If not, otoolbar could be a property, in which case the Enabled setting would throw an error.
>
>*snip*
In addition oToolBar may be a property with a data type of O and still have a value of NULL, that's why I suggest using TYPE("oToolBar.cmdExit.Name") = "C". There can also be a toolbar that doesn't have a cmdExit in it. The only way the cmdExit button's name property will be type C is if the toolbar and the command button both exist. The performance issue here is insignificant as it is a single test that will be not be perceived by any human that I know of.