VBA login to site

bensonsearch

Well-known Member
Joined
May 26, 2011
Messages
844
Hi All,
I can not get the below to work, the logins are the right ones feel free to use as not a problem

Code:
Dim oHTML_Element As IHTMLElement
Dim sURL As String
'On Error GoTo Err_Clear
sURL = "[URL]http://www.abbyyonline.com/en/Account/LogOn[/URL]"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
'oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.READYSTATE = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
    
    ie.document.all.Item(UserName).Value = "[EMAIL="nickolas.benson@gordongotch.com.au"]nickolas.benson@gordongotch.com.au[/EMAIL]"
    ie.document.all.Item("password").Value = "Benson14"
'HTMLDoc.all.Email.Value = "[EMAIL="nickolas.benson@gordongotch.com.au"]nickolas.benson@gordongotch.com.au[/EMAIL]"
'HTMLDoc.all.passwd.Value = "Benson14"
For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
' oBrowser.Refresh ' Refresh If Needed
'Err_Clear:
'If Err <> 0 Then
'Debug.Assert Err = 0
'Err.Clear
'Resume Next
'End If

the code never enters the info
 
ok there is a little toggle button to turn flash off which then it makes it typable. just need to find out how to do that :)
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
ok i now have this
Code:
Dim oHTML_Element As IHTMLElement
Dim sURL As String
'On Error GoTo Err_Clear
sURL = "[URL]http://www.abbyyonline.com/en/Account/LogOn[/URL]"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
'oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True
Do
' Wait till the Browser is loaded
Loop Until oBrowser.READYSTATE = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
    
   
HTMLDoc.getElementById("username").Value = "[EMAIL="nickolas.benson@gordongotch.com.au"]nickolas.benson@gordongotch.com.au[/EMAIL]"
HTMLDoc.getElementById("password").Value = "Benson14"

Set chk = HTMLDoc.getElementsByName("rememberme")(0)
    chk.Click
    chk.Click
    HTMLDoc.getElementById("Submit").Click
Do
  ' Wait till the Browser is loaded
Loop Until oBrowser.READYSTATE = READYSTATE_COMPLETE
Application.Wait (Now() + TimeValue("00:00:04"))
oBrowser.navigate ("[URL]http://finereader.abbyyonline.com/en/Task/Queue[/URL]")
Do
  ' Wait till the Browser is loaded
Loop Until oBrowser.READYSTATE = READYSTATE_COMPLETE
Application.Wait (Now() + TimeValue("00:00:04"))
'temp = oBrowser.LocationURL
'Set HTMLDoc = oBrowser.document
''oBrowser.navigate "[URL]http://finereader.abbyyonline.com/en/Account/UseFlash/NoFlash[/URL]"
Do
  ' Wait till the Browser is loaded
Loop Until oBrowser.READYSTATE = READYSTATE_COMPLETE
'Application.Wait (Now() + TimeValue("00:00:04"))
Set HTMLDoc = oBrowser.document
'HTMLDoc.getElementById("userFileName").Value = "G:\SalesMktg\National Contact Center\Gotch\testing\upload.pdf"
HTMLDoc.getElementById("theFile").Click
Application.Wait (Now() + TimeValue("00:00:01"))
this gets the dialog box to open, i have even tried send keys but cant figure a way to type in the box. nor can i figure a way in the non flash page how to just pass the path of the file :( please help
 
Upvote 0
I've only seen it done using Windows API.

If you search here you might find some code, I think John w has posted a bit of code to deal with the 'standard' download dialog.

I know you are uploading but it might give you a start/some ideas.
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,849
Members
449,194
Latest member
HellScout

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top