What is the diff between the Create Object and Get object?

Answers were Sorted based on User's Feedback



What is the diff between the Create Object and Get object?..

Answer / guest


Create Object - To create an instance of an object.
Get Object ? To get the reference to an existing object.

Is This Answer Correct ?    10 Yes 0 No

What is the diff between the Create Object and Get object?..

Answer / abcd

1. CreateObject creates an instance of a class
2. GetObject gets the reference of an running object
to another object
3. Always use CreateObject except for Windows
Management Instrumentation (WMI) and Active Directory
Service Interfaces (ADSI)
The below script demonstrates the use of these two VBScript
functions.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add

Set objExcel2 = GetObject(, "Excel.Application")
Set objWorkbook = objExcel2.Workbooks(1)
Set objWorksheet = objWorkbook.Worksheets(1)
objExcel2.Cells(1, 1).Value = "In god I TRUST everything
else I TEST."

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More Visual Basic Interview Questions

How do I set the Windows wallpaper at runtime?

0 Answers  


State about the different types of visual basic data?

0 Answers  


What is ActiveX Document?

1 Answers  


Hai! , i make a project for browsing center using vb6.0 , at the time of running below mentioned error is occured so please help me for solve this problem. Error : Can't find project or library

4 Answers   Wipro,


How to get freefile location in memory?

0 Answers   FSS,






what is the Default property of datacontrol ?

2 Answers  


Explain OLE Drag and Drop.

0 Answers  


How can you filter out specific type of file using file system controls?

0 Answers  


What are the rules which should be followed while naming a variable in VB?

0 Answers  


Difference between Class Module and Standard Module?

0 Answers  


What can you do with visual basic?

0 Answers  


How many max. number of controls can place in one form (especially visual basic form)?

6 Answers   Satyam,


Categories