Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to close a Window obj with a "text:="& ReportName
#1
Not Solved
Currently, the code below close all of my objects with micclaasss = window. I need to close a Window obj with a "text:="& ReportName & ".*" only.

How do I add this in?

Code:
Sub CloseWindow (ReportName)

   'CLOSE REPORTNAME BROWSER
        Set oWindow=Description.Create()
        oWindow("micclass").Value="Window"
        Set obj=Desktop.ChildObjects(oWindow)
        For i=0 to obj.Count-1
        obj(i).Close
        Next

End Sub

Do i just add:
oWindow("text").Value=ReportName
Reply
#2
Not Solved
Code:
oWindow("text").Value="ReportName.*"
Reply
#3
Not Solved
Rajpes,

thx

Should it not be:
oWindow("text").Value= ReportName & ".*"

ReportName is a dynamic variable.

Either way, this did not close the Window with the ReportName that I had hoped. It closed all of my windows even messing with logging me off. lol
Reply
#4
Not Solved
Code:
Set oWindow=Description.Create()
oWindow("micclass").Value="Window"
oWindow("text").Value=ReportName&".*"
Set obj=Desktop.ChildObjects(oWindow)

msgbox obj.count
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to close/restart UFT in "Not responding" status with AOM script CharlieMadrid 0 1,229 05-21-2020, 08:46 PM
Last Post: CharlieMadrid
  Object doesn't support this property or method: 'window(...).window(...).winobject' senthil5683 1 3,674 07-04-2016, 07:08 PM
Last Post: venkatesh9032
  Dynamic obj rep - get text in the class (html) marcio cravo moreira 0 2,123 05-26-2015, 06:58 PM
Last Post: marcio cravo moreira
  Read text from text file and save it into a variable in qtp arpan 3 12,957 06-19-2013, 08:34 PM
Last Post: arpan
  Need to compare two text files - ignoring some text nelly27281 2 4,577 09-09-2012, 12:09 PM
Last Post: freeboynil

Forum Jump:


Users browsing this thread: 2 Guest(s)