VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Describes OLE automation Thru VB

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

Rate 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]

Download this snippet    Add to My Saved Code

Describes OLE automation Thru VB Comments

No comments have been posted about Describes OLE automation Thru VB. Why not be the first to post a comment about Describes OLE automation Thru VB.

Post your comment

Subject:
Message:
0/1000 characters