kinsleyd
15 years agoContributor
Looping through an array
I'm populating an array with the FindAllChildren method, which is generating a list of all the links on a specific web page. I then try to use the members of that array to open up those links. For some reason, the ToURL method is locking the array after the first iteration of the loop and blows up directly there after: blah2 is the array in question
(blah2) >= 0
If UBound(blah2) >= 0 Then
(blah2) >= 0
For i = o to ubound(blah2)
blah3 = Project.Variables.server & "gsa/webbas01.nsf/(vwwebpage)/" & blah2(i).nameProp
Set iexplore = Aliases.iexplore
iexplore.ToURL(blah3)'nav_to_page blah3
next
else msgbox("no values returned")
End If
I do not know how to overcome this. Its interesting to note that if I use the NavigateTo method vs. ToURL the loop continues without error (there are actually message boxes in the code that verify this), but the navigateto method does nothing. So I need a hybrid method of the ToURL / NavigateTo method - one that actually opens the page but does not lock the array subsequently. That, or a way to get around the locking of the array, if that's what you call it.
Any advice is welcome.