+ Reply to Thread
Results 1 to 6 of 6

User -defined type not defined how to solve?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Arrow User -defined type not defined how to solve?

    i got an error while running the code
    the error is
    User -defined type not defined

    /*yellowcolor shows at here
    Sub M_snb()
    With New WinHttpRequest*/

    Sub M_snb() 
        With New WinHttpRequest 
            .Open "GET", "http://www.suggestadoctor.com/doctors_list_al_310_alabama_urology.htm", False 
            .Send 
             
            For Each it In Filter(Split(Replace(Replace(.ResponseText, "<a", "~<a"), "</a>", "~"), "~"), "'doctor_") 
                c01="" 
                .Open "Get", "http://www.suggestadoctor.com/" & Split(it, "'")(1), False 
                .Send 
                st = Split(.ResponseText, vbLf) 
                For j = 1 To 7 
                    c01 = c01 & vbLf & Filter(st, Choose(j, "City :", "ZIP :", "Phone #", "Fax #", "Gender", "Medical School", "Graduation Year"))(0) 
                Next 
            Next 
        End With 
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    49,625

    Re: User -defined type not defined how to solve?

    Set a reference to Microsoft WinHTTP Services. You can do that by clicking on menu tools | references.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: User -defined type not defined how to solve?

    Thanks for ur help i set Microsoft WinHTTP Services but when i run after that it get error at For statement

    variable not defined

    For Each it In Filter
    Last edited by anilg0001; 05-09-2013 at 12:48 AM.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: User -defined type not defined how to solve?

    add a new line to the start of the routine
    dim it, st, c01, j
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Forum Contributor
    Join Date
    04-06-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    193

    Re: User -defined type not defined how to solve?

    thanks Mr. JosephP
    While i corrected that i got another error msg like
    Run-Time Error '9'
    Subscript our of range

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: User -defined type not defined how to solve?


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1