by manikantan (12 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 25th October 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Describes OLE automation Thru VB
Manikantan
3rd Agenda,
Web Development,
India.
Website:www.3rdagenda.com
Email:[email protected]
OLE Automation
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
Getobject(pathnam,class)
to open an excel object the syntax is
Getobject("c:\text.xls","Excel.sheet")
alternate to Getobject is the createobject method which has the following syntax
createobject(class)
The Following code helps opening an object in XLS
Dim XLSsheet as object
set XLSsheet=Getobject("text.xls","excel.sheet")
XLSsheet.application.visible=true
XLSsheet.cells(1,1).value=10
XLSsheet.cells(1,2).value=11
XLSsheet.cells(1,3).value="=r1c1-r1c1"
msgbox(XLSsheet.cells(1,3).value)
Thus an Exposed object can be used to do the calculation rather than doing that at the client end.
Article By
Manikantan
email:[email protected]