Hello all,
I have the following codes, but instead of creating a new object(Internet Explorer) I want to change a value on the Internet Expolorer sheet that is already open. How can I do this or combine these macros.
And I prefer using the Microsoft Edge as browser (for this macro), but I read that it is not possible, can someone confirm this?
Any help is much appreciated!
Kind regards,
Justin
I have the following codes, but instead of creating a new object(Internet Explorer) I want to change a value on the Internet Expolorer sheet that is already open. How can I do this or combine these macros.
VBA Code:
Sub Change_value_Internet_sheet()
Dim IE As Object
Dim doc As HTMLdocument
Set IE = CreateObject("Internetexplorer.Application")
IE.Visible = True
IE.Navigate "https://www.mrexcel.com/search/"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.Document
Windows("Test").Activate
Range("A1").Select
With doc
.getElementById("field-email").Value = Range("A1").Value
End With
End Sub
VBA Code:
Sub Active_Internet_sheet()
Dim sw As Object, IE As Object
Set sw = CreateObject("Shell.Application").Windows
For Each IE In sw
'distinguish Internet Explorer from Windows Explorer
If InStr(UCase(IE.FullName), "\IEXPLORE.EXE") <> 0 Then
ShowWindow IE.hwnd, 2
ShowWindow IE.hwnd, 3
SetActiveWindow IE.hwnd
End If
Next
End sub
And I prefer using the Microsoft Edge as browser (for this macro), but I read that it is not possible, can someone confirm this?
Any help is much appreciated!
Kind regards,
Justin