I need to find a way to automatically log into the following website, choose a drop-down and enter a search value from Excel vba to automate some processes for work. I have tried on two different versions of Excel, 2003 and 2010, with all different kinds of codes to no avail. I even tried the code from the posting at Excel VBA: Login to Website
and that doesn't work. Here is what I was using:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
Wend ' wait for page to load...
If Not oIE.Document.forms(1).elements("login") Is Nothing Then
oIE.Document.forms(1).elements("login").Value = "YourLoginName"
oIE.Document.forms(1).elements("password").Value = "YourPassword"
Where the username and password would be changed to what I need them to be. Please help.