PDA

View Full Version : VBA to fill in IE fields



sharcky627
01-02-2014, 02:15 PM
I have read several posts on how to fill IE fields in using vba and have successfully written scripts to fill in information for several common websites (yahoo, gmail etc.) However, I am currently having an issue filling in fields to log in to Hyperion Workspace. The script below worked for yahoo mail, but when modified with the Hyperion Workspace URL and HTML fields, IE launches and navigates successfully but the fields are not filled in or submitted:


Here is the VBA and HTML exerts that i am currently using.
HTML
11026



Sub login()
Dim objie As InternetExplorer
Dim uid As String
Dim pwd As String
Dim rng As Range
Set objie = New InternetExplorerMedium
objie.Visible = True
uid = "johndoe"
pwd = "XXX"
'first tested this with yahoo to make sure the syntax was correct
'objie.navigate "URL here"
'Then put the actual website in
objie.navigate "URL here"

Do Until objie.readyState = 4
DoEvents
Loop
'Hyperion workspace HTML fields
objie.document.getElementById("bpm.Logon.1.txtUser").Value = uid
objie.document.getElementById("bpm.Logon.1.txtPassword").Value = pwd
'yahoo html fields
'objie.document.getElementById("username").Value = uid
'objie.document.getElementById("passwd").Value = pwd
For Each objieform In objie.document.forms
objieform.submit
Exit For
Next
End Sub

ashleyuk1984
01-02-2014, 03:42 PM
The screenshot capture you provided is too small, I can barely make it out by getting 3 inches away from my screen.
Are you able to share the URL with us? That way we can test and debug the code to get it working for you.

sharcky627
01-02-2014, 06:24 PM
Thank you and sorry for the small screen shot of the HTML, it does not seem to like pasting pictures into the text box. Please take a look at the new attachment.

Also, I attempted to include the link but got an error saying I had not posted on these forums enough to include a link (need a minimum of 5)

Please let me know if the new attachment works better for viewing the HTML

sharcky627
01-03-2014, 04:59 PM
here it is, spaced were added to allow the post <http :// am-hyperiondemo.com :19000/workspace/index.jsp>

sharcky627
01-07-2014, 10:23 AM
Any help with this would be greatly appreciated. Or maybe just a couple of guesses on html/form/security reasons why this may not work. As mentioned I have used this successfully with a ton different websites and never had an issue before.

westconn1
01-11-2014, 10:21 PM
tested, the form is within a frameset frame

Set f = Wb.document.frames(0)
f.document.getelementbyid("bpm.logon.1.txtuser").value = "username"
f.document.getelementbyid("bpm.logon.1.txtpassword").value = "xxx"
f.document.getelementbyid("bpm.Logon.1.btnLogon").Click
' wait for page to load etc

where wb is an instance of IE, that has already navigated to the link posted and fully loaded

blackrosegul
01-09-2015, 02:38 AM
I attempted to include the link but got an error saying I had not posted on these forums enough to include a link (need a minimum of 5)
Please let me know if the new attachment works better for viewing the HTML..??