DOCUMENT:Q241932 20-JUL-2001 [vbwin] TITLE :PRB: Run-Time Error 13 While Running VB DHTML Applications PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5,6.0 OPER/SYS: KEYWORDS:kbMSHTML kbVBp600 kbGrpDSInet kbie500bug kbDSupport ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning Edition for Windows, version 6.0 - Microsoft Visual Basic Professional Edition for Windows, version 6.0 - Microsoft Visual Basic Enterprise Edition for Windows, version 6.0 - Microsoft Internet Explorer (Programming) version 5 ------------------------------------------------------------------------------- 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, ....) MORE INFORMATION ================ Steps to Reproduce Behavior --------------------------- 1. On a computer with Internet Explorer 5 installed, run Visual Basic 6. 2. Select a new DHTML Application template. 3. On the default DHTMLPage designer (DHTMLPage1), add the following code in Document_onclick. PutProperty BaseWindow.Document, "SomeName", "SomeValue" 4. Run the application. 5. Click on the document. REFERENCES ========== For more information on developing Web-based solutions for Internet Explorer, please see the following Web sites: http://msdn.microsoft.com/workshop/entry.asp http://msdn.microsoft.com/ie/ http://support.microsoft.com/highlights/iep.asp?FR=0&SD=MSDN For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base: Q190249 INFO: VB 6.0 Readme Part 9: DHTML Page Designer Issues Q190050 PRB: BuildFile Property of DHTML Application Is Missing Additional query words: page designer putproperty getproperty ====================================================================== Keywords : kbMSHTML kbVBp600 kbGrpDSInet kbie500bug kbDSupport Technology : kbVBSearch kbIEsearch kbAudDeveloper kbZNotKeyword6 kbSDKIESearch kbZNotKeyword2 kbVB600Search kbVB600 kbIE500Search kbSDKIE500 Version : WINDOWS:5,6.0 Issue type : kbprb ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2001.