Microsoft KB Archive/279668

= PRB: You Receive &quot;Run-Time Error 5&quot; When You Call the Navigate2 Method of the WebBrowser Control =

Article ID: 279668

Article Last Modified on 4/21/2006

-

APPLIES TO


 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q279668



SYMPTOMS
In a Microsoft Visual Basic application, when you call the Navigate2 method of the WebBrowser control, and then you pass string variables as parameters, you may receive the following error:

run-time error 5 &quot;Invalid procedure call or argument&quot;



RESOLUTION
To resolve this problem, use variant-type variables instead of strings.



STATUS
Microsoft has confirmed that this is a problem in in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
 Start Visual Basic. Create a new Standard EXE project. By default, Form1 is created.  Add a WebBrowser control to Form1, and then add the following code to Form1: Sub Form_Load Dim strUrl As String ' To resolve the problem, change to Variant. ' For example: Dim strUrl As Variant

strUrl = &quot;http://www.microsoft.com/&quot; WebBrowser1.Navigate2 strUrl End Sub 

