Code Samples for Businesses, Schools & Developers

First Published 30 Nov 2017                    Last Updated 29 Nov 2022


An earlier version of this article was originally posted at Access World Forums in Nov 2017:
How to fix Google maps display issues in an Access web browser control

A few months before that, I started experiencing issues displaying Google maps in an Access web browser control.

The issue was that the map loaded perfectly for a second or so followed by a pop up window advising you to switch off compatibility mode.
When this was dismissed, all of the map except the outer edge disappeared!

Online searches revealed that this had been a problem for many users for at least 5 years. However, for some reason Google & Microsoft hadn't fixed it.

The problem is that by default the Access web browser control is designed for IE7 which of course is out of date and no longer supported.



NOTE:
The web browser control still uses Internet Explorer rather than Edge
A replacement web browser control based on the Chromium Edge browser was originally promised for 2020 but has been repeatedly delayed

However, I am pleased to report that the new web browser control is now under active developement and is likely to be released by March 2023.
Although it is no longer listed on the Access 365 Roadmap, it is now marked as one of the development priorities for the 6-month period Oct 2022-Mar 2023



Anyway, I found a solution involving changes to the registry which worked perfectly until I had to reinstall Windows on a new hard drive.
The problem returned immediately.

I tried various suggested fixes as shown below before finding the registry fix once again.
I'm posting all the methods I tried as others may not need the registry fix.



1.   Disable script errors

Add the following line to your code:

Me.YourWebBrowserControlName.Object.Silent = True


The above code will block any script errors but will not fix the issues causing them



2.   Turn off Compatibility view

Taken from a Google support article: Use Google Maps on Internet Explorer

Open Internet Explorer.

In the top right, click Tools. (If you don't see the icon, press the F10 key to see it.)
Click Compatibility View Settings.
Under “Websites you’ve added to Compatibility View," select google.com.
Click Remove.

CompatibilityView
As I didn't have Google listed, this clearly was no use - at least for me



3.   Remove all Google sites from [Trusted sites] in the [Security] tab of [Internet Options]

Taken from an answer at Google Maps Forum: Google Maps Disappear

TrustedSites
Once again this solution wasn't applicable for me The above code will block any script errors but will not fix the issues causing them



4.   Use software rendering instead of GPU rendering in Internet Explorer

Taken from a Microsoft support article: How to enable or disable software rendering in Internet Explorer

SoftwareRendering
Again, that didn't help me - in fact it made the issue worse. The above code will block any script errors but will not fix the issues causing them



5. Update the registry so Access uses IE11 (or whichever version of IE you have on your machine)

Taken from various answers at Stackoverflow forum: Access WebBrowser Control and Google maps

This involves editing the registry to make your version of IE (probably IE11) the default.

As always, the standard warning about any changes to the registry are done at your own risk

Doing this involves two new keys being added to the HKEY_CURRENT_USER hive (for just you) or if preferred to HKEY_LOCAL_MACHINE (all users)
This method works perfectly - at least for me ....

Open the registry then find the key:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION

Right click and select New ... DWord Value
Enter MsAccess.exe then right click .. Modify .. Decimal and enter 11001 or preferably 12001. See below for explanation.

RegistryEdit
Next, repeat the same process for the following key:
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_DOCUMENT_COMPATIBLE_MODE

A quicker way is to use the attached registry file (.reg) file.

Click to download the registry file:     Google Maps Registry Fix     1 kB     (zipped)

Unzip .. right click and select Merge
It will add the following 4 keys ... though you don't really need HKCU if you add HKLM

'==========================================================

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl]
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] "MSAccess.exe"=dword:00002ee1
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_DOCUMENT_COMPATIBLE_MODE] "MsAccess.exe"=dword:00002ee1

[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl]
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION] "MSAccess.exe"=dword:00002ee1
[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_DOCUMENT_COMPATIBLE_MODE] "MsAccess.exe"=dword:00002ee1

'===========================================================



NOTE:
This approach can be adapted for any other program instead of MSAccess.exe or for different versions of IE.
Here is a list of the values that you might want to use:

12001 - Edge emulation mode
11001 - IE11 Standards mode
11000 - IE11 Default Mode
10001 - IE10 Standards Mode
10000 - IE10 Default Mode
9999 - IE9 Standards Mode
9000 - IE9 Default Mode
8888 - IE8 Standards Mode
8000 - IE8 Default Mode
7000 - IE7




UPDATE 1 May 2022:
Mike Wolfe suggested a simple way of checking the IE browser version in a article at his NoLongerSet website:
     Why Does My Access Web Browser Control Default to IE 7?

Add a Web Browser control to a form in Access and set its Control Source property to ="https://www.whatismybrowser.com/"
Switch to Form View. Click through several Javascript errors and eventually you will see something like the following:

IE7 Emulation

IE7 mode

IE11 Emulation

IE11 mode

Edge Emulation

Edge mode

Click to download an example database you can use to do this:     IE Web Browser Version Checker     0.4 MB     (zipped)



UPDATE 29 Nov 2022:
Any VBA code that requires the use of the Google Javascript API, no longer works in the IE web browser control as Internet Explorer is no longer supported. You will see this message:

JavascriptError
Unfortunately, there appears to be no workround available at this time. We must wait for the new Edge browser control to be released.



6. Further reading

There is an excellent article about the web browser control at Daniel Pineault's DevHut website:
      Everything You Never Wanted to Know About the Access WebBrowser Control



7. Feedback

I hope this article has been of use to others and, even if not, I know where to find the solution for my own future reference!

Please use the contact form below to let me know whether you found this information useful or if you have any questions.



Colin Riddington           Mendip Data Systems                 Last Updated 29 Nov 2022



Return to Code Samples Page




Return to Top