views:

227

answers:

1

BACKGROUND: The following works in Access 2007, but broke when I installed 2010

I have a WebBrowser control in an Access Form; I set its location as follows

Me.WebBrowser0.ControlSource = "http://foo.com"

and then execute a script in the page

Script = "StartScript(null);"
Me.WebBrowser0.Object.Document.parentWindow.execScript Script, "JavaScript"

This worked just fine in Access 2007, but immediately after installing 2010 I got the following pop-up error:

Run-Time error '-2147024891 (80070005)':
Access is Denied.

Any ideas?

A: 

WORKAROUND:

Not sure why the following works, but it does.
Web page saved locally to hard drive, added the following line to the beginning of the file

<!-- saved from url=(0014)about:internet -->

Disabled protected mode;
Changed Me.WebBrowser0.ControlSource to

Me.WebBrowser0.ControlSource = "file://T:/foo.html"
Noah