Link to home
Start Free TrialLog in
Avatar of mike_allred
mike_allred

asked on

VBscript array Permission denied

This should be simple, but I'm missing something.
I've got a script that populates an array, then should loop through the array and perform an action.  When that action is to display a message box with the value of the array at that iteration, it works.  When I try to perform a different action (bring up a web page that uses that array value as part of a URL), the first iteration of the loop works, but then I get a 'Permission Denied' error.
If I make the commented msgbox below the action vs. the call statement directly below it, and comment the call statement it runs.  If I reverse it back, blows up on i = 1.
There's gotta be something I don't understand.  Any ideas?  TIA
If UBound(blah2) >= 0 Then
        For i = 0 To UBound(blah2)
           blah3 = "http://domainname.com/" & blah2(i).nameProp
          'msgbox (blah3)
            call iexplore.ToURL(blah3)
         next
    else msgbox("no values returned")
    End If

Open in new window

Avatar of JoltinJoe
JoltinJoe
Flag of United States of America image

Does blah2(1) = null?
ASKER CERTIFIED SOLUTION
Avatar of TakedaT
TakedaT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mike_allred
mike_allred

ASKER

No, blah(1) returns a value when I simply display it in a text box.
Lol... nice variables... :)
TakedaT - that solved the issue with the array - thanks!  I opened up a couple of other issue however.  The .Run is opening a new instance of IE for each iteration.  And it is not waiting for the page to load, which the ToURL method does (which I suppose is proprietary to the testing platform I'm using here, TestComplete, a web application regression tester, which is pretty handy).

I guess that suggests I need to figure out what is blowing up with the ToURL method.  Sure looked like it was a problem with the array, but apparently that's not the case
Nice work, Sir.  
For what you are trying to do, you can probably use the InternetExplorer.Application object.  Without having your environment to test, its hard to say how to do it.  You can find a lot of documentation on it by simply searching the web.  Here is a few links.  You can also search EE for examples.

http://msdn.microsoft.com/en-us/library/aa768398(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa752084(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa752093(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa158131(office.10).aspx