Create Object Function

 
Tips >>ASP Functions


WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The CreateObject function creates an object of a specified type. Automation servers provide at least one type of object. For example, a word-processing application may provide an application object, a document object, and a toolbar object. To create an Automation object, assign the object returned by CreateObject to an object variable. The parameter is servername which describes the name of the application that provides the object. The parameter is typename which describes the type/class of the object. The parameter is location which describes optional where to create the object.

The Syntax of CreateObject function is :-

CreateObject(servername.typename[,location])

Example#1 :-

Code :-
dim myexcelSet myexcel=CreateObject ("Excel.Sheet") myexcel.Application.Visible=True... code... myexcel.Application.QuitSet
myexcel=Nothing

 

Example#2 :-

Code :-
<%
Set objWrd = CreateObject("Word.Application")
...
' Place any code you desire here
...
Set objWrd = Nothing
%>

In this second example, we create an object on a remote site.

Example#3 :-

Code :-
%
lt%
Set objFarAway = CreateObject("Word.Application", "FarAwayServerName")
...
' Place any code you desire here
...
Set objFarAway = Nothing
%>

 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

Whatsapp Icon +91-9967648641

Whatsapp Icon +91-9967648641