Microsoft KB Archive/241932

= PRB: Run-Time Error 13 While Running Visual Basic DHTML Applications =

Article ID: 241932

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Internet Explorer 5.0

-



This article was previously published under Q241932



SYMPTOMS
When running Visual Basic Dynamic HTML (DHTML) Projects on machines with Internet Explorer 5 or later installed, the following error message appears:

Run-time error '13':

Type mismatch

This error occurs while calling PutProperty or GetProperty functions generated by the default template of Visual Basic.



CAUSE
The first parameter of the above two functions is of type HTMLDocument and BaseWindow.Document cannot be passed to it.



RESOLUTION
Change the first parameter of the PutProperty and the GetProperty declaration objDocument As HTMLDocument to objDocument As Object. As in the following example: Public Sub PutProperty(objDocument As Object, ....)



Steps to Reproduce Behavior
 On a computer with Internet Explorer 5 installed, run Visual Basic 6. Select a new DHTML Application template.  On the default DHTMLPage designer (DHTMLPage1), add the following code in Document_onclick. PutProperty BaseWindow.Document, "SomeName", "SomeValue"  Run the application. Click on the document.</ol>

<div class="references_section">