What is the diff between the Create Object and Get object?
Answer Posted / 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 View All Answers
How do I implement an accelerator key for a text box?
How would you add elements and pictures to listitems in listview control?
What do you know about user forms.
How do I prevent multiple instances of my program?
How can you filter out specific type of file using file system controls?
what is use of book mark in excel ? send answer in my id ashishpal11@rediffmail.com
what is the Difference between Recordset and Querydef?
What is meant by Establish Connection in RDO? 74.1s it possible to Access BackEnd procedures? Explain.
Differentiate between DAO,ADO and Adodc as in data access objects?
What is ado in vb?
What is the use of progress Bar Control?
Is there any way to pass a variable to a form apart from using global variables?
Explain about trees structures work.
How would you add elements in TreevieW Control.
which property is used to change to some value to access a identity column in datacontrols?