is there a vb.net equivalent for CreateObject?

R

Ron

Hello,

I have to invoke instances of MS Excel and MS Access from
my vb.net applications so that I can invoke procedures
that reside in the Excel and Access applications from the
vb.net application (as in remotely). After I make a
reference to the com object library for Excel or Access I
use CreateObject to instantiate an session of Excel or
Access. This works, but occasionally I have a problem.
Is there a .Net equivalent for CreateObject (or GetObject)?

Thanks,
Ron
 
I

Imran Koradia

CreateObject and GetObject are still the functions you'd use to create/"get"
COM objects. However, if you are adding a reference to the object library,
you should be able to create the objects without using CreateObject as well:
Dim app As Excel.Application, etc. That way, you will have strongly typed
objects make your application more robust. If you are having trouble with
closing down Excel, Access, etc, you might want to look into this article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;317109


hope that helps..
Imran.
 
R

Ron

Thanks for the reference.

Ron

-----Original Message-----
CreateObject and GetObject are still the functions you'd use to create/"get"
COM objects. However, if you are adding a reference to the object library,
you should be able to create the objects without using CreateObject as well:
Dim app As Excel.Application, etc. That way, you will have strongly typed
objects make your application more robust. If you are having trouble with
closing down Excel, Access, etc, you might want to look into this article:
http://support.microsoft.com/default.aspx?scid=kb;EN- US;317109


hope that helps..
Imran.





.
 

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