Hi all,
I have a web form page to populate using Excel VBA. My data is in 4 columns and has over 2000 lines. For each line, I need to send the values of the first 3 columns to specific fields, then the "ENTER" key must be pressed, the macro will require to wait for the webpage to update, then send the value of the 4th column and finalize with another "ENTER" key pressed. Then it needs to move on to the second line of data and repeat the process till the end of spreadsheet data.
This web form doesn't have any buttons to click, it must be an "ENTER" key pressed.
I found this bit of code posted by Domenic back in 2018 and it works perfectly for what I need to do, but I have trouble figuring out how to send the "ENTER" key to the webpage and wait.
Can someone help me out ?
Thanks in advance.
Here is the code:
Option Explicit
Sub Login()
Dim oShell As Object
Dim oShellWindows As Object
Dim oShellWindow As Object
Set oShell = CreateObject("Shell.Application")
Set oShellWindows = oShell.Windows
For Each oShellWindow In oShellWindows
If oShellWindow.Name = "Internet Explorer" Then
If oShellWindow.Document.Title = "identificazione" Then
With oShellWindow.Document
.all("entry.402896772").Value = ThisWorkbook.Sheets("Foglio1").Range("D2").Value
.all("entry.249387921").Value = ThisWorkbook.Sheets("Foglio1").Range("E2").Value
'etc
'
'
End With
Exit For
End If
End If
Next oShellWindow
Set oShell = Nothing
Set oShellWindows = Nothing
Set oShellWindow = Nothing
End Sub
I have a web form page to populate using Excel VBA. My data is in 4 columns and has over 2000 lines. For each line, I need to send the values of the first 3 columns to specific fields, then the "ENTER" key must be pressed, the macro will require to wait for the webpage to update, then send the value of the 4th column and finalize with another "ENTER" key pressed. Then it needs to move on to the second line of data and repeat the process till the end of spreadsheet data.
This web form doesn't have any buttons to click, it must be an "ENTER" key pressed.
I found this bit of code posted by Domenic back in 2018 and it works perfectly for what I need to do, but I have trouble figuring out how to send the "ENTER" key to the webpage and wait.
Can someone help me out ?
Thanks in advance.
Here is the code:
Option Explicit
Sub Login()
Dim oShell As Object
Dim oShellWindows As Object
Dim oShellWindow As Object
Set oShell = CreateObject("Shell.Application")
Set oShellWindows = oShell.Windows
For Each oShellWindow In oShellWindows
If oShellWindow.Name = "Internet Explorer" Then
If oShellWindow.Document.Title = "identificazione" Then
With oShellWindow.Document
.all("entry.402896772").Value = ThisWorkbook.Sheets("Foglio1").Range("D2").Value
.all("entry.249387921").Value = ThisWorkbook.Sheets("Foglio1").Range("E2").Value
'etc
'
'
End With
Exit For
End If
End If
Next oShellWindow
Set oShell = Nothing
Set oShellWindows = Nothing
Set oShellWindow = Nothing
End Sub