Control Selection Failed Run-Time Error
I have a block of code in a script (subroutine) which reads as follows:
Private Sub Select_Systems_For_Merge(FileList() As String)
Dim intI As Integer
For Each objData In DotNETTreeView("Name=trvAvailable").Items
For intI = 0 To UBound(FileList)
If Trim(FileList(intI)) = "" Then Exit For
If UCase(objData.Item(1)) = UCase(FileList(intI)) Then
DotNETButton("Name=btnMoveTo").Click 'Move selected file to selected list
The purpose of this block of code is to compare each item (objData) in the list of available items (DotNETTreeView("Name=trvAvailable")) with a list of valid files to select from that list (FileList). For each match, the script selects that matched item and moves it to the selected list. It is to repeat this process until all of the items from FileList are reviewed and selected if there is a match.
However, during the course of the item selection, a pop-up error window displays "Control Selection Failed" message (see attachment).
Can anyone please explain how/why this happened? It is not supposed to happen, unless it relates to improper use of the DotNETTreeView object. Is that the case? Please advise as I have a critical deadline to meet WRT this script. Your prompt response is very much appreciated. Thanks.
Re: Control Selection Failed Run-Time Error
Since this is dealing with a TreeView object, the selected item needs to have a "\" in front, then it will work. But this is only for single-level objects in the TreeView object.