Automate Internet explorer with Excel VBA Part 1

Share
Embed
  • Published on Jul 3, 2016
  • Support Amarindaz on Patreon: goo.gl/it9Gpk --~--
    Theme: How to open google webpage using Internet explorer from Excel VBA
    Visit My Blog: www.amarindaz.com
    Are you beginner to Excel VBA ? Check out my ebook: www.amarindaz.com/go/excel-vba/
    Facebook page: facebook.com/amarindaz
    Recommended Excel VBA books
    ===================================================
    www.amarindaz.com/go/excel-vba-24-hour-trainer/
    www.amarindaz.com/go/excel-2016-power-programming-vba/
    www.amarindaz.com/go/excel-2013-power-programming-vba/
    ====================================================
    In this video, you'll learn how to
    1)Open internet explorer
    2)navigate to google web page
    3)Wait until the browser gets loaded
    4)Close the browser
    using Excel VBA
    Code for Automating Internet explorer with Excel VBA
    ===============================
    Sub iepart2()
    Dim ie As Object
    Set ie = CreateObject("internetexplorer.application")
    With ie
    .Visible = True
    .navigate "www.google.co.in"

    Application.Wait (Now + TimeValue("00:00:05"))
    Application.Wait (Now + TimeValue("00:00:05"))
    .Quit
    End With
    End Sub
    ===============================
    Please subscribe

Comments • 20

  • Recep Yilmaz
    Recep Yilmaz 2 months ago

    Hi, I follow your videos and Like thats.
    I want to create an vba code to autocomplet a web from from worksheet datas.
    its work for 1 row data. i using the
    " For rowNo = 2 to 10
    ....
    next "
    but not working for me. apple all settings your learning. can you help me please sir?

  • Mukesh Kumar
    Mukesh Kumar 5 months ago

    Only for Internet Explorer run this code. Not work in Google Chrome

    • Amarindaz
      Amarindaz  5 months ago

      Yes . Only can work on Internet explorer through Excel VBA

  • Mukesh Kumar
    Mukesh Kumar 5 months ago

    How to use this cod by userform in Excell

  • Devendra
    Devendra 7 months ago

    Hi Amarindaz nice video... im facing a problem with internet explorer popups like... save file, open file or save passwrds.. pls help with the code how to manipulate IE messages.. thanks in advance.

  • Janelou Maizo
    Janelou Maizo Year ago

    how about the wholw workbook

  • indu ECE
    indu ECE Year ago

    i get the error in "Set ie = CreateObject(“internetexplorer.application”)" how to resove that?? plz help me..

    • Amarindaz
      Amarindaz  Year ago

      +indu ECE not sure why you're getting this do you have IE installed on your system. Probably if I look at the settings I'll get idea

    • indu ECE
      indu ECE Year ago

      Set ie = CreateObject(“InternetExplorer.Application”) - this line sir

    • Amarindaz
      Amarindaz  Year ago

      +indu ECE which line it's pointing to

    • indu ECE
      indu ECE Year ago

      yes sir, i removed. bt now i get "Run time error 424 object required " error message. how to resolve that sir?

    • Amarindaz
      Amarindaz  Year ago

      +indu ECE plz remove option explicit at the very first line

  • Sugat M
    Sugat M Year ago

    HI Amar,
    How to check if a textbox in a webpage is hidden or not thru vba

  • kamalakar b
    kamalakar b Year ago

    Hi Sir, I am an asst professor in engg college in india. I need to do result analysis for the examination results. I need to pull out the data from the web and then process it further. I am developing a macro to pull the data. I am able to open the webpages. But could not proceed further to get these data into excel. Can you help help me in this.
    i am able to open the web pages for the roll numbers y16me1201, y16me1202,y16me1203,y16me1204,y16me105. pasted in colum A of excel sheet. I run this vba code
    Sub results()
    Dim IE As Object
    Dim j As Integer

    For j = 1 To 5

    Set IE = CreateObject("InternetExplorer.Application")
    IE.Navigate "www.nagarjunauniversity.ac.in/btech11semregcrdec16..."
    IE.Visible = True
    Do While IE.readyState READYSTATE_COMPLETE
    Loop
    IE.document.all("hno").Value = ThisWorkbook.Sheets("sheet1").Cells(j, 1).Value
    IE.document.getelementsbytagname("INPUT")(1).Click

    Next
    End Sub
    After open the webpages i am not sure how to get this data into excel. could you please help me in ths regard

  • Krish
    Krish 2 years ago

    Hi... thank you for videos. "Recommended Excel VBA books" links are not working, could you please provide working links.

  • Benjamin Mottram
    Benjamin Mottram 2 years ago

    Hi. Great video. what does "doevents" actually do here? just PAUSES/WAITS the script until ready state = 4? (or not busy)?