The easiest way is to enclose the critical part of code which needs OLE registration into TRY - CATCH structure:
LOCAL oException
TRY
*-- commands using OLE registration
CATCH TO oException
*-- Here you can look at the error description in oException and decide what to do
FINALLY
*-- cleanup
ENDTRY
More onfo is e.g. here:
http://msdn.microsoft.com/en-us/library/z08sy19a(VS.80).aspxYou could also decide about more sophisticated way: Read Windows Registry settings...