Using Google in form (1 Viewer)

Dave E

Registered User.
Local time
Yesterday, 22:29
Joined
Sep 23, 2019
Messages
104
Hi all,

I have a form with an embedded google webpage which is opened when a user selects a button on the mainview page to obtain more info on the selected item.

It all works well except for the assembly of the searchstr, which I can do manually but not in VBA...yet.

So, I have a string (Tempstr) e.g. "acer palmatum dissectum viridis" which, for the browser, I have changed to "acer+dissectum+dissectum+viridis"

The searchstr for Google is then assembled as -

"browser.co.uk/?q=acer+palmatum+dissectum+viridis"

But I can't seem to get the contents of Tempstr into the searchstr. I end up with -

"browser.co.uk/?q=Tempstr"

I think I'm missing something simple but I haven't found out what it is yet.

Can anyone help?

NOTE: I had to remove any hint of a link from the above so please read the word browser as G...le.
 

MrHans

Registered User
Local time
Today, 07:29
Joined
Jul 27, 2015
Messages
147
The search string is a variable, the url is fixed.
So it should be:

"browser.co.uk/?q=" & Tempstr
 

isladogs

MVP / VIP
Local time
Today, 06:29
Joined
Jan 14, 2017
Messages
18,246
This works

Code:
Sub test()

Dim Tempstr As String

Tempstr = "acer+palmatum+dissectum+viridis"
Application.FollowHyperlink "http://www.google.co.uk/?q=" & Tempstr

End Sub
 

Users who are viewing this thread

Top Bottom