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

ID: Q241932


The information in this article applies to:
  • Microsoft Visual Basic Learning, Professional, and Enterprise Editions 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.


  4. 
    PutProperty BaseWindow.Document, "SomeName", "SomeValue" 
  5. Run the application.


  6. Click on the document.



REFERENCES

For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp


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 kbGrpInet kbIE500bug kbDSupport
Version : WINDOWS:5,6.0
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: December 14, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.