int li_ret li_ret = ole_object.connecttoobject( " ", "Excel.Application ")
if li_ret <> 0 then li_ret = ole_object.ConnectToNewObject( "Excel.Application ") if li_ret <> 0 then MessageBox( 'OLE错误 ', 'OLE无法连接!错误号: ' + string(li_ret)) return 0 end if end if