Switched to Windows 10 now my code fails! (Internet Explorer Control)

razzandy

Active Member
Joined
Jun 26, 2002
Messages
390
Office Version
  1. 2007
Platform
  1. Windows
Hi All

Installed Windows 10 from Win 7 now my code fails.

My Code basically opens Internet Explorer navigates to a web address then the below code error's out:

Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop

The Error is: Run-Time Error '462': The remote server machine does not exist or is unavailable

I do have IE as well as Edge and my code still does open IE and navigates to the web page.

References Selected are:
Microsoft HTML Object Library
Microsoft Internet

Thanks in advance

;)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Below is my code:

Sub LogInToWebsite()

cURL = "https://Removed" 'Enter the web address here
Const cUsername = "Removed" 'Enter your user name here
Const cPassword = "Pemoved" 'Enter your Password here

Dim IE As InternetExplorer
Dim doc As HTMLDocument
Dim LoginForm As HTMLFormElement
Dim UserNameInputBox As HTMLInputElement
Dim PasswordInputBox As HTMLInputElement
Dim SignInButton As HTMLInputButtonElement
Dim HTMLelement As IHTMLElement
Dim qt As QueryTable

Set IE = New InternetExplorer

IE.Visible = True
IE.Navigate cURL

'Wait for initial page to load

Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop

Set doc = IE.Document

'Get the only form on the page

Set LoginForm = doc.forms(0)

'Get the User Name textbox and populate it
'input name="Email" id="Email" size="18" value="" class="gaia le val" type="text"

Set UserNameInputBox = LoginForm.elements("login:username")
UserNameInputBox.Value = cUsername

'Get the password textbox and populate it
'input name="Passwd" id="Passwd" size="18" class="gaia le val" type="password"


Set PasswordInputBox = LoginForm.elements("login:password")
PasswordInputBox.Value = cPassword

'Get the form input button and click it
'input class="gaia le button" name="signIn" id="signIn" value="Sign in" type="submit"

Set SignInButton = LoginForm.elements("submit_btn")
SignInButton.Click

'Wait for the new page to load

Do While IE.ReadyState <> READYSTATE_COMPLETE Or IE.Busy: DoEvents: Loop

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,339
Messages
6,124,373
Members
449,155
Latest member
ravioli44

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