Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is diference between createobject() and Getobject()
Message
From
10/04/2002 05:21:20
 
 
To
10/04/2002 05:03:17
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00643051
Message ID:
00643055
Views:
10
both functions are used for assigning object reference.
however createObject function creates new object
while the GetObject function is mostly used to assign a reference to existing object though you can also create new obects with it.
Dim xlApp As Excel.Application
'if excel is running then
Set xlApp = GetObject(,"Excel.Application") 'xlApp references existing obj
Set xlApp = GetObject("","Excel.Application") 'xlApp references new object
'if excel is not running then
Set xlApp = GetObject(,"Excel.Application") 'give Error
Set xlApp = GetObject("","Excel.Application") 'start the excel and xlApp references new object
Best Luck..
Nilesh
Previous
Reply
Map
View

Click here to load this message in the networking platform