Results 1 to 8 of 8

VBA to Pull Data from Log in Website

Threaded View

rlee12 VBA to Pull Data from Log in... 03-02-2013, 08:45 AM
AKK9 Re: VBA to Pull Data from Log... 03-02-2013, 10:15 AM
rlee12 Re: VBA to Pull Data from Log... 03-02-2013, 09:15 PM
AKK9 Re: VBA to Pull Data from Log... 03-02-2013, 09:35 PM
rlee12 Re: VBA to Pull Data from Log... 03-03-2013, 08:43 AM
AKK9 Re: VBA to Pull Data from Log... 03-04-2013, 06:42 AM
rlee12 Re: VBA to Pull Data from Log... 03-04-2013, 10:44 PM
AKK9 Re: VBA to Pull Data from Log... 03-09-2013, 10:31 AM
  1. #1
    Registered User
    Join Date
    02-28-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    21

    VBA to Pull Data from Log in Website

    Hello. I am new to excel program and am experience some issues. I am attempting to use excel to log in to a web page and navigate to the correct sub page before copying a table and pasting it into excel.

    The issues I am having are below:

    1) The first selection is in a drop down box.

    2) It opens up a new window you enter user name

    3) It needs to log out after finished

    I have wrote some code that works using sendkeys... but there has to be a better way of using code to find the specified drop down list, text box, or table on a webpage.
    Private Sub Workbook_Open()
    
    Dim appIE As Variant
    
    Set appIE = CreateObject("InternetExplorer.Application")
    
    appIE.Visible = True
    
    appIE.navigate "xxxxxxx"
    
    Application.Wait Now + TimeValue("00:00:02")
       
    SendKeys "{TAB 18}", True
    SendKeys "{DOWN 1}", True
    SendKeys "{TAB 6}", True
    SendKeys "xxxxx", True
    SendKeys "{ENTER}", True
    Application.Wait Now + TimeValue("00:00:03")
    SendKeys "xxxxx", True
    SendKeys "{ENTER}", True
    Application.Wait Now + TimeValue("00:00:08")
    SendKeys "{TAB 14}", True
    SendKeys "{ENTER}", True
    Application.Wait Now + TimeValue("00:00:05")
    SendKeys "^a", True
    SendKeys "^c", True
    
     ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
        False, NoHTMLFormatting:=True
    
    End Sub
    Last edited by Leith Ross; 03-02-2013 at 02:55 PM. Reason: Added Code Tags

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