How to check if a COM object is registered

T

Totto

Hi,
Is there a way to check if a COM object is registered in VBA(Excel).
I'm currently using CreateObject() and just lets it fail, is this the way to
do it ?
 
K

Karl E. Peterson

Totto said:
Is there a way to check if a COM object is registered in VBA(Excel).
I'm currently using CreateObject() and just lets it fail, is this the way to
do it ?

That's certainly the easiest, yeah.
 
G

Galin Iliev

hi
try this code :))
this is the way

Dim aaa
On Error Resume Next
Set aaa = CreateObject("TSCGWebInstallere.Update")
If Err.Number = 449 Then
MsgBox "The com is not registered"
GoTo end_exit:
End If
' The com not registered here
end_exit:


Galin Iliev
MCSD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top