Microsoft KB Archive/168431

= FIX: Launching Visual Basic 5.0 ActiveX Documents from Internet Explorer =

Article ID: 168431

Article Last Modified on 10/24/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition

-



This article was previously published under Q168431



SYMPTOMS
When browsing to an ActiveX Document using Microsoft Internet Explorer, the document will fail to load the associated VBD file correctly. Instead, Microsoft Internet Explorer will display the following message:

"Opening:

from 

Some files can contain viruses or otherwise be harmful to your

computer. It is important to be certain that this file is from a

trustworthy source.

What would you like to do with this file?"

The user is presented with a choice of Opening or Saving the VBD file. If the user selects Open, the Open With window is displayed asking which application should launch the file. None of the applications listed, including Microsoft Internet Explorer, will successfully launch the VBD file.



CAUSE
The Setup Wizard for Microsoft Visual Basic 5.0 creates a set of files to be used for Internet download of ActiveX Documents. These files include a cabinet (CAB), VBD, and a hypertext-markup HTM file.

Unfortunately, without changes to the HTM file, an ActiveX Document will not launch correctly when a user browses to the HTM file using Microsoft Internet Explorer 3.x.



RESOLUTION
Below is a sample of an original HTM file created using the Microsoft Visual Basic 5.0 Setup Wizard. Following the example, is another sample that shows a working HTM file.

Example 1 - Original HTM File
  

 Sub Window_OnLoad Document.Open Document.Write "" Document.Write "" Document.Write "" Document.Close End Sub  

Example 2 - Changed HTM File
  </OBJECT> <SCRIPT LANGUAGE="VBScript"> Sub Window_OnLoad Location.Replace("SampleDoc1.vbd") End Sub </SCRIPT> </HTML> The changes to the Window_OnLoad procedure allow the VBD file to be launched successfully, thus the ActiveX Document will initialize and display within Microsoft Internet Explorer.

To convert an HTM file created with Setup Wizard, do the following: <ol> <li>Make a copy of your original HTM file.</li> <li>Open the Original HTM file into Notepad.</li> <li>Remove the lines in the Window_OnLoad procedure. Make note of the VBD filename on the third line of the procedure.</li> <li> Place the following code within the Window_OnLoad procedure: Sub Window_OnLoad Location.Replace("FILENAME.vbd") End Sub where "FILENAME.VBD" must be replaced with the name of your VBD (including quotation marks).

</li> <li>Save the HTM file.</li></ol>

<div class="status_section">

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

This bug was corrected in Internet Explorer 4.0.

Keywords: kbdownload kbbug kbfix kbfaq kbcode KB168431

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.