Call Shell with URL with Parameters

DavidatSchool

New member
Local time
Today, 21:40
Joined
Aug 11, 2008
Messages
8
Hi
From Access VB, I want to post a URL with parameters.
I've used:
ReturnValue = Shell("explorer.exe " & strUrl, vbNormalNoFocus)
where strUrl has a value of
http://www.google.co.uk/search?hl=en&newwindow=1&q=frog
When executed, I get a message
"The path frog does not exist or is not a directory".
I can url encode the url, which then avoids the error, IE launches, but the url encoded url gives a page not found error.
Has anyone any ideas? Has anyone launched IE with a url with parameters successfully from Access?
Thanks
 
explorer isnt ie - its windows explorer isnt it

you want iexplore or something like that i think
 
Well, you would have thought so! But iexplore.exe (which does seem to be the executable for IE) gives a "file not found" message.
If there's no parameters on the URL, IE launches fine with explorer.exe (explorer detects it's a URL).
It's only when there's parameters it has a problem.
 
Have you tried:

Application.FollowHyperlink "http://www.google.co.uk/search?hl=en&newwindow=1&q=frog"
 
Er, no I haven't ByteMyzer, and looks like I should have!

That works a treat - and simpler than working with postdata in the activex control I was attempting as an alternative.

As a follow up, is there a command which would close that browser window (or open it silently?). I know it doesn't make sense in the above example, but can I post data to a website and "catch" the response (which is an html page which says "ok" or "error") without the access user knowing anything about it?

Many thanks for the help with the original query - one problem solved.
 
Er, no I haven't ByteMyzer, and looks like I should have!

That works a treat - and simpler than working with postdata in the activex control I was attempting as an alternative.

As a follow up, is there a command which would close that browser window (or open it silently?). I know it doesn't make sense in the above example, but can I post data to a website and "catch" the response (which is an html page which says "ok" or "error") without the access user knowing anything about it?

Many thanks for the help with the original query - one problem solved.

If what you wish is to pass an HTTP GET query to the Google search engine and to retrieve the results in VBA, you should look at the XMLHTTP object. For an example, check out the following link:

http://www.access-programmers.co.uk/forums/showpost.php?p=774849&postcount=6
 
Thank you ByteMyzer and Wazz - I will try out the suggestions and post a note as/when I get something working.
 
And finally, all working superbly.
I went for ByteMyzer's XMLHTTP solution for my "follow up" problem - thank you for pointing me at that solution.
Thanks for your time - I do try a variety of keywords to find solutions, but sometimes miss the ones that would save everyone a lot of time as the solution was already there!
 
... I do try a variety of keywords to find solutions, but sometimes miss the ones that would save everyone a lot of time as the solution was already there!

Don't feel badly; it can be difficult if you don't know the specific keywords that will return the most relevant results. One of the best things about this forum is that there are so many Users who are willing to work with the Poster to determine the actual underlying issue and to work toward a solution.

Excellent news. I'm glad it worked for you.
 

Users who are viewing this thread

Back
Top Bottom