03-05-2010, 02:21 AM
This will close the last opened browser.
Code:
Function CloseLastOpenedBrowser()
Dim oDescription
Dim BrowserObjectList
Dim oLatestBrowserIndex
Set oDescription=Description.Create
oDescription("micclass").value="Browser"
Set BrowserObjectList=Desktop.ChildObjects(oDescription)
oLatestBrowserIndex=BrowserObjectList.count-1
Browser("creationtime:="&oLatestBrowserIndex).close
Set oDescription=Nothing
Set BrowserObjectList=Nothing
Print "Close Category Total Report browser pdf"
Reporter.ReportEvent 0, "Browser PDF" , "Report closed successfully"
End Function