Load/unload GUI Repositories during run-time (QTP, VBScript)

Categories: Source code

Load GUI Repositories

Set FSO = CreateObject("Scripting.FileSystemObject")
For GuiFile in GUICollection
'Check if file exists
 boolRC = FSO.FileExists(GuiFile)
 If Not boolRC Then
 'Error-handling, reporting
 Exit Function
 End If
'Check if GUI repository is already loaded
 intPos = RepositoriesCollection.Find(GuiFile)
 If intPos = -1 Then
 RepositoriesCollection.Add GuiFile
 End If
Next
Set FSO = Nothing

Unload GUI Repositories

For GuiFile in GUICollection
'Check if GUI repository is really loaded
 intPos = RepositoriesCollection.Find(GuiFile)
 If intPos <> -1 Then
 RepositoriesCollection.Remove GuiFile
 End If
Next

  • Leave a Reply

    * Required
    ** Your Email is never shared

Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by the author is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.