Solved

User-defined type not defined VB6

Posted on 2004-04-02
3
3,405 Views
Last Modified: 2009-07-29
This is an example from Microsoft.
Put al the code in form, added the components mshtml.dll and shdocvw.dll.
Get the following error while trying to run the code.

User-defined type not defined

Dim Sws As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer

Private Sub Form_Load()
   Dim Doc
   List1.Clear
   List2.Clear

   Text1.Text = Sws.Count

   For Each IE In Sws
      List1.AddItem IE.LocationName

      Set Doc = IE.Document
      If TypeOf Doc Is HTMLDocument Then
         'if this is an HTML page, display the title
         'may or may not be the same as LocationName
         List2.AddItem Doc.Title
      End If
   Next
End Sub
0
Comment
Question by:Renebo
3 Comments
 
LVL 19

Expert Comment

by:Shauli
ID: 10745239
Replace these line:
Dim Sws As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer

With these lines:
Dim Sws As New SHDocVwCtl.ShellWindows
Dim IE As SHDocVwCtl.InternetExplorer

S

0
 
LVL 39

Expert Comment

by:appari
ID: 10745263
on which line are you getting the error?
its running fine on my m/c
0
 
LVL 27

Accepted Solution

by:
Ark earned 250 total points
ID: 10746590
Hi
VB Menu->Project->References-> Check Microsoft Internet Contols and Microsoft HTML Object Library
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now