Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WebBrowser on Excel Form.... won't navigate, says unsupported browser... 1

Status
Not open for further replies.

SnayJ

Programmer
Feb 27, 2008
65
US
Using Office 365 - Excel.

I have a form ESTPAYMENTWMAPfrm, on which I have some textboxes with data and a WebBrowser object. WebBrowser object is named MAPBLOCK.

All I want to do is when the form opens, I want the WebBrowser object to navigate to a url. Eventually I'll use a cell value, but just to get it to work, I've been trying to hard code it... and it won't work. I keep getting a browser like error saying "You seem to be using an unsupported browser". My code is as follows:

Code:
Dim mb As WebBrowser
Set mb = MAPBLOCK
mb.Navigate "[URL unfurl="true"]http://maps.google.com/?q=college+station+texas"[/URL]

The thing is, IT WAS WORKING.... so I know it's not an unsupported issue. Don't know what I did to make it not work.
[*EDIT* oh and it does work for but not for maps. But IT DID before.]
When I had it working, I had followed this video....changing the address from a .com.au to just a .com. And it was working after the change. But now for some reason, it's not working.

Any thoughts would be greatly appreciated.


SnayJ
 
Here's the problem - no matter what version of IE you have installed on your PC, the webbrowser control is emulating IE7 - and Google Maps hasn't supported IE7 for some time (note that just because support was dropped does not mean that Maps immediately stopped working, just that it would eventually stop working and that Google would not care).

Right now the only versions of IE that are officially supported are 10 and 11.

Fortunately there is a registry modification you can make that should change how the webbrowser control works in specific applications.

ON a per user basis: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

For all users: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

(and for 32bit apps on 64bit platform: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION)

The keyname is then the EXE name of your application, in your case excel.exe, and the values are as per MSDN

So, in your case (assuming you have IE11 installed), we'd likely want

[pre]HKEY_CURRENT_USER
SOFTWARE
Microsoft
Internet Explorer
Main
FeatureControl
FEATURE_BROWSER_EMULATION
excel.exe = (DWORD) 11000(or 2AF8 if entering value as hexadecimal)[/pre]



 
So that means that I can only use webbrowser control in 1 Office application at a time? If I set it to Excel, I can't do it in Access then? I'm using Office 365 which apparently is 16. I'll look more into this later (after work) and get back to the thread. Thanks for responding.

SnayJ
 
>So that means that I can only use webbrowser control in 1 Office application at a time?

Nope. You can have as many entries under FEATURE_BRIWSER_EMULATION as you need/like, e.g. if you wanted Excel and Word (and wanted to ensure IE11 capability), then:

FEATURE_BROWSER_EMULATION
excel.exe = 11000
winword.exe = 11000

> I'm using Office 365 which apparently is 16.

Irrelevant. It is the browser version that is important, not the version of the software you are running (browser version is NOT tied to Office version)

 
Ok... sorry it took so long to get back to it. I did the regedit and it still isn't working. I did have to update Chrome, but now it says I'm up to date and still won't work. Please remember, it does work for but not or And when put into a standard browser (outside of excel), my url paths work fine. Thoughts?

SnayJ
 
If it is no longer warning about being out if date, then that specific problem has been successfully fixed. I'm afraid that your problem has now become 'my program does not work' and There's too little info for us to work with. But if you mean that you are still having the exact same error,then it suggests that you did not make the registry entry correctly. Should look something like this:

lookslikethis_z1ffrj.png


As you can see, a number of other applications already have entries in my registry; yours may differ.

Please note that the solution provided is nothing to do with Chrome. And nothing to do with a standard browser. It only affects the Microsoft webrowser control. Nor does it matter that it works for other URLs.
 
Strongm, thanks very much for that. Everything is working now. (Star Awarded - Big Thanks)

New problem - you are amazing if you can figure this out. Because I've actually found forum posts around on the internet about it, but all without a fix.

What I'm trying to do is have a Google Map search result display, but the problem is the left side of the browser gets a sidewindow popout....

see here:
I want to collapse the side panel - much like the "Collapse side panel" button at the top-right of the panel.

I have found some videos talking about automating webpages in order to get data from them. i.e., going to Google, typing in the search bar and clicking the search button. But I couldn't rewrite the code to click the "Collapse side panel" button... also couldn't find the "id" after inspecting the element.

Additionally for a different project:

I would like to get the browser to match the size of the control. Say for instance I created a form that was (on screen) only 3" tall x 4" wide.... and navigated to Netflix. How could I get Netflix to display zoomed in on the size of the webbrowser control. Currently if I do it, I would only get the top left 3" x 4" of a standard size Netflix browser (fullsize).

Any help in either of those issues would be greatly appreciated.

SnayJ
 
You might want to pose your questions in new threads so things don't get confused.

But very quickly: Google Maps uses JavaScript event delegation, and I've not figured out a way of dealing with that from VBA, so cannot advise on how to use the click event to close the panel (there is an alternative way, using an iFrame, that eliminates the panel completely, but it slightly changes the behaviour of Google Maps)

As for Netflix - it is supposed to resize itself, so I don't know why you are getting what you describe.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top