View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Randy Harmelink Randy  Harmelink is offline
external usenet poster
 
Posts: 122
Default Filling out usernames in IE

Antonio wrote:
As Paul D mentioned earlier, it is possible to launch IE from within VBA
(Code at the end)

Is it possible to input a username as well?


You just have to be able to find out how to fill in the username. For
example, I have an EXCEL spreadsheet I use to create portfolios on
Yahoo! that fills in the forms iteratively. The routine below is used
to find the FORM on the page, then to fill in each item of the FORM,
then CLICK on the save option of the FORM. It does this until my list
of transactions is at an end. Here's the routine:

Sub YahooAddPortfolioTransactions()
Set oForm = oIE.Document.forms(0)
For Each oCell In Sheets("Yahoo! Portfolio
Transactions").Range("A2:A500")
If oCell.Value = "" Then Exit For
oForm("y").Value = oCell.Offset(0, 0)
oForm("m").Value = oCell.Offset(0, 1) - 1
oForm("d").Value = oCell.Offset(0, 2)
oForm(".act").Value = oCell.Offset(0, 3)
oForm(".sym").Value = oCell.Offset(0, 4)
oForm(".units").Value = oCell.Offset(0, 5)
oForm(".unitprice").Value = oCell.Offset(0, 6)
oForm(".comm").Value = oCell.Offset(0, 7)
oForm(".note").Value = oCell.Offset(0, 8)
oForm(".save2").Click
Do: DoEvents: Loop While oIE.Busy
Do: DoEvents: Loop Until oIE.ReadyState = READYSTATE_COMPLETE
Set oForm = oIE.Document.forms(0)
Next oCell
oForm(".cancel").Click
End Sub