Solved

User-defined type not defined VB6

Posted on 2004-04-02
3
3,434 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 28

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code 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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

791 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