[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

User-defined type not defined VB6

Posted on 2004-04-02
3
Medium Priority
?
3,621 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 1000 total points
ID: 10746590
Hi
VB Menu->Project->References-> Check Microsoft Internet Contols and Microsoft HTML Object Library
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month17 days, 23 hours left to enroll

830 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