is there a vb.net equivalent for CreateObject?

  • Thread starter Thread starter Ron
  • Start date Start date
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
 
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.
 
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.





.
 
Back
Top