• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

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

0
mike_allred
Asked:
mike_allred
1 Solution
 
JoltinJoeCommented:
Does blah2(1) = null?
0
 
TakedaTCommented:
Im not sure what method you are trying to use, but does this work for you?
Set objShell = CreateObject("wscript.shell")
If UBound(blah2) >= 0 Then
        For i = 0 To UBound(blah2)
           blah3 = "http://domainname.com/" & blah2(i).nameProp
          'msgbox (blah3)
            objShell.Run "iexplore.exe "&blah3
         next
    else msgbox("no values returned")
End If

Open in new window

0
 
mike_allredAuthor Commented:
No, blah(1) returns a value when I simply display it in a text box.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Jared LukerCommented:
Lol... nice variables... :)
0
 
mike_allredAuthor Commented:
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
0
 
mike_allredAuthor Commented:
Nice work, Sir.  
0
 
TakedaTCommented:
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
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now