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

After executing this code its showing the error.

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

Can you brief out exactly what are you trying to do ?
Reply
#3
'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
I tried ur code and it is perfectly working.

R u executing the below thru QTP or .vbs file ?
Reply
#5
I am not using QTP. I am using .vbs file.
Reply
#6
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 3,043 11-08-2017, 11:15 PM
Last Post: lotos
  Need help in creating dynamic object string using Childobjects Keshub Mathur 0 2,038 09-11-2017, 05:52 PM
Last Post: Keshub Mathur
  General Object Error(Find Object Error) akhandesh 1 4,151 02-24-2016, 01:05 PM
Last Post: sindhus
  How to find out the object property in the Description language . njnirmal 9 7,981 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,510 11-14-2014, 05:35 PM
Last Post: swapna.9n9

Forum Jump:


Users browsing this thread: 1 Guest(s)