EdgeBrowserControl firing events too often?
11:43 17 Aug 2026

I am using the EdgeBrowserControl with MS Access.

As far as I experienced, I consider there are some problems with the events firing. Can somebody confirm or deny?

The _NavigateError event

... almost always fires, after about half a second, with StatusCode 4 (Connection Aborted). After that, the page will load properly.

The _DocumentComplete event

... fires almost always twice - the first time below one second of time, the second time when the page REALLY has fully loaded. With "loaded", I mean the browser has transmitted the full web page document content. (I have a PHP script running that takes about 15 seconds to process/transmit; only then it closes the connection).

  • I tried to work around with testing .ReadyState = acComplete, but that seems to be as wrong (or let's say: premature) as the firing of the _DocumentComplete event.

  • Then I tried .RetrieveJavascriptValue("null") - that seemed to run into timeouts (i. e. returning a Timeout... string message) if the page is not fully loaded. So I could use that.

  • But even then I was doubtful: I had cases of .RetrieveJavascriptValue("null") succeeding, but .RetrieveJavascriptValue("document.body") being undefined (or null?) - which I considered a sign of: the document is still not loaded.

Finally I use - and I trust only the following condition:

.RetrieveJavascriptValue("new Boolean(document.body).toString()") = "true"
  • RetrieveJavascriptValue won't return booleans, I noticed - that's the reason for the new Boolean ... toString stuff

  • The condition includes the case when RetrieveJavascriptValue returns some "Timeout ..." string: Then, the condition evaluates to false.

vba ms-access vba7