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
Bookmarks