CreateObject with CLSID

M

Michael

I have an easy question. Can you use CreateObject in VBA with a CLSID rather
than a ProgId? I've tried it both with and without braces and I cannot get
runtime error 429: "ActiveX component can't create object"

Thanks,

Michael
 
K

Karl E. Peterson

Michael said:
I have an easy question. Can you use CreateObject in VBA with a
CLSID rather than a ProgId? I've tried it both with and without
braces and I cannot get runtime error 429: "ActiveX component can't
create object"

CreateObject doesn't accept CLSID's, no. But, you _could_ use the CLSID to find the
ProgId in the registry, although that sure seems like a lot of trouble. Why are you
hoping to go this way?
 
M

Michael

Attempting to debug a problem, not for use in an application. I'll work
around it.

I wonder why they don't accept a CLSID. It would not have taken much effort
to do so. I've implemented that in many COM api's I've written in C++.

Michael
 
K

Karl E. Peterson

Michael said:
Attempting to debug a problem, not for use in an application. I'll
work around it.

Try this:

CLSIDToProgID - Convert a CLSID into a ProgID
http://www.devx.com/vb2themax/Tip/18927
I wonder why they don't accept a CLSID. It would not have taken much
effort to do so. I've implemented that in many COM api's I've
written in C++.

Welcome to Basic.

What's hard is easy; what's easy can be hard. ;-)
 

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