NavigationCompleted Event  
 

The NavigationCompleted event occurs when a navigation finishes loading and indicates whether it was successful or not.

Syntax

Sub object_NavigationCompleted ( [Index As Integer,] ByVal Location As String, ByVal ErrorCode As Long )

Remarks

The NavigationCompleted event occurs when a navigation request has finished loading. It is triggered regardless of whether the navigation succeeded or failed, with the Location argument being the URL and the ErrorCode argument indicating any failure. Applications typically handle this event to update their UI once the content has loaded, or to implement custom error handling when navigation fails. Because the event always fires, even on errors, it is a reliable notification point for the end of a navigation sequence.

If the navigation has failed, ErrorCode will be non-zero and can be one of the following values:

Constant Value Description
webErrorCertificateName 1 Certificate common name mismatch.
webErrorCertificateExpired 2 Certificate is expired.
webErrorInvalidCredentials 3 Invalid or untrusted client certificate.
webErrorCertificateRevoked 4 Certificate has been revoked.
webErrorInvalidCertificate 5 Certificate is invalid for another reason.
webErrorServerUnreachable 6 Cannot reach the server/host.
webErrorTimeout 7 Operation timed out.
webErrorInvalidServerResponse 8 Server returned an invalid or unexpected response.
webErrorConnectionAborted 9 Connection aborted by the server or network.
webErrorConnectionReset 10 Connection was reset.
webErrorDisconnected 11 Disconnected during the operation.
webErrorCannotConnect 12 Failed to establish a connection.
webErrorHostNameNotResolved 13 DNS resolution failed for the host.
webErrorOperationCanceled 14 Operation was canceled by the user or host.
webErrorRedirectFailed 15 Redirection failed.
webErrorUnexpectedError 16 An unexpected error occurred.
webErrorCredentialsRequired 17 Authentication credentials are required.
webErrorProxyAuthRequired 18 Proxy authentication is required.

See Also

Navigate Method, NavigationStarting Event