Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error while creating object using description.create object in VB script
#1
Not Solved
Code:
Dim objVar
set objVar=description.create

After executing this code its showing the error.

Object required description
Reply
#2
Not Solved
I am not getting any error.

Can you brief out exactly what are you trying to do ?
Reply
#3
Not Solved
'Create a description for browser

Code:
Set oBrowser = Description.Create
oBrowser("micclass").Value = "Browser"

'Get all browsers
Set allBrowser = Desktop.ChildObjects(oBrowser)

Dim i, iCount

iCount = allBrowser.Count - 1

For i = 0 To iCount
    
allBrowser(i).Close
  
Next




After executing the above code I am getting the error as "Object required 'Description'
Reply
#4
Not Solved
I tried ur code and it is perfectly working.

R u executing the below thru QTP or .vbs file ?
Reply
#5
Not Solved
I am not using QTP. I am using .vbs file.
Reply
#6
Not Solved
I think Description.Create does not support in .vbs file as it belongs to QTP.

Try below code to close all browsers thru .vbs file

Code:
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colProcesses = objWMIService.ExecQuery( "Select * from Win32_Process where name = 'iexplore.exe'")
For Each objProcess in colProcesses
objprocess.terminate
Next
Set colProcesses = Nothing
Set objWMIService = Nothing
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Is there a way to create dynamic objects by declaring the type of object as parameter lotos 3 2,236 11-08-2017, 11:15 PM
Last Post: lotos
  Need help in creating dynamic object string using Childobjects Keshub Mathur 0 1,629 09-11-2017, 05:52 PM
Last Post: Keshub Mathur
  General Object Error(Find Object Error) akhandesh 1 3,692 02-24-2016, 01:05 PM
Last Post: sindhus
  How to find out the object property in the Description language . njnirmal 9 6,726 05-19-2015, 12:30 AM
Last Post: qtptester66523
  If Object name is completely changing then I am unable to recognize that object swapna.9n9 0 2,161 11-14-2014, 05:35 PM
Last Post: swapna.9n9

Forum Jump:


Users browsing this thread: 1 Guest(s)