WebBrowserControl.NavigateError event (Access)

Occurs when an error occurs during navigation.

Syntax

expression.NavigateError (pDisp, URL, TargetFrameName, StatusCode, Cancel)

expression A variable that represents a WebBrowserControl object.

Parameters

Name Required/Optional Data type Description
pDisp Required Object A pointer to an IDispatch interface for the WebBrowserControl object that represents the window or frame in which the navigation error occurred.
URL Required Variant Contains the URL for which navigation failed.
TargetFrameName Required Variant Contains the name of the frame in which to display the resource, or Null if no named frame was targeted for the resource.
StatusCode Required Variant Contains an error status code, if available.
Cancel Required Boolean Specifies whether to cancel the navigation to an error page or to any further autosearch.

Return value

Nothing

Remarks

This event fires before the WebBrowserControl object displays an error page due to an error in navigation. You can stop the display of the error page by setting the Cancel parameter to True. However, if the server contacted in the original navigation supplies its own substitute page navigation, when you set Cancel to True, it has no effect, and the navigation to the server's alternate page proceeds.

For example, assume that a navigation to https://www.www.wingtiptoys.com/BigSale.htm causes this event to fire because the page does not exist. However, the server is set to redirect the navigation to https://www.www.wingtiptoys.com/home.htm. In this case, when you set Cancel to True, it has no effect, and navigation proceeds to https://www.www.wingtiptoys.com/home.htm.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.