VBA automation error: -2125463506 (8150002e)

bunburyst

New Member
Joined
Apr 18, 2018
Messages
24
Hey guys!

I have a problem with my VBA code to login a website. Sometimes it works perfectly, but other times i get automation error: 2125463506 (8150002e).




My OS is Windows 10. In windows 7 i didnt get this error.


Can anyone have a look an tell me how I must have the macro?
Any help is appreciated. Thanks:

Code:
Dim HTMLDoc As HTMLDocumentDim MyBrowser As InternetExplorer
 Sub Repsol1()


 Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
Dim form As HTMLFormElement
    MyURL = "https://login.repsol.com/es/Landing/AuthnPage?returnUrl=https://www.repsol.com/es_es/"
    Set MyBrowser = New InternetExplorer
    MyBrowser.Silent = True
    MyBrowser.Navigate MyURL
    MyBrowser.Visible = True
    Do
        DoEvents
    Loop Until MyBrowser.ReadyState = READYSTATE_COMPLETE
 
    Set HTMLDoc = MyBrowser.Document


    Do While HTMLDoc.getElementById("gigya-login-form") Is Nothing
        DoEvents
    Loop


    Set form = HTMLDoc.getElementById("gigya-login-form")


    form.all.UserName.Value = "aperson@somecompany.com"
    form.all.Password.Value = "password"
   
 
    form.getElementsByClassName("gigya-input-submit")(0).Click


Do
 Loop Until MyBrowser.ReadyState = READYSTATE_COMPLETE
 With CreateObject("InternetExplorer.Application")
        .Visible = True
        .Navigate "https://www.repsol.com/es_es/aplicaciones/SO/WebEESS/default.aspx?usuario=g0021581"
End With

End Sub
[COLOR=#333333]
[/COLOR]


Error debug: code line "
Set MyBrowser = New InternetExplorer"






 
Last edited by a moderator:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Thanks for your answer but it does not work.

Before starting the macro I tried to kill the "iexplorer.exe" process and it works, but I would like to find another solution.
On the other hand, sometimes the VBA code does not load the user and the password, "Run-time error 91 Object variable or With block variable not set".

¿?¿? :(
 
Last edited:
Upvote 0
I tried your code and it loaded the page and populated the username and password fields.

I've seen this automation error occasionally. The fix is usually to kill all the iexplore.exe (not iexplorer.exe) processes and, if it exists, the ielowutil.exe process, and run the code again.

To fix the error 91 try:
Code:
    Do
        Set form = HTMLDoc.getElementById("gigya-login-form")
        DoEvents
    Loop While form Is Nothing
 
Upvote 0
Solution
I may be late but I've had that 8150002e issues for a while.

I seem to have just solved it by putting this line in just before the set ie= line

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Call Shell("cmd.exe taskkill /F /IM /c iexplore.exe")

Hope this helps even though it took so long
[/FONT]
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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