Microsoft & .NETVisual BasicOLE Automation Servers

OLE Automation Servers content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Ole Automations are very powerful in Visual Basic it is a further advancement to linking objects.Using OLE automation we can control the source Document from within our application .The control can happen through the objects that are exposed by the source Document.

The Getobject method.

A Getobject method can open to excel objects and use them to create a client/Server application. The Getobject method has the following syntax:


To open an excel object the syntax is:


Alternate to Getobject is the createobject method which has the following syntax:


The Following code helps opening an object in XLS:

Dim XLSsheet as object
set XLSsheet=Getobject("text.xls","excel.sheet")

Thus an Exposed object can be used to do the calculation rather than doing that at the client end.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories