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
What is the use of Data Form Wizard?
What is the use of command Object?What are the various types of variables?
How do I speed up control property access?
How do I create a new form in visual basic?
what is the Difference between Dynaset and Snapshot?
How would you convert a form into document?
Which type of object requires this object?
Explain about the creation of EXE files with Visual Basic?
What is the difference between change event in normal combobox and dbcombobox?
What are the important components of OLEDB?
What is meant by Establish Connection in RDO?
What is the use of Tabledef?
How do I set the Windows wallpaper at runtime?
State about the different types of visual basic data?
DHTML Is used for what?