09-08-2022, 04:54 PM
I wonder if you can help me please.
I'm trying to write a bit of VBS code in Excel to populate web forms
The website is similar to this one with a login and then I want to be able to send private messages
I have to use the Shell function to be able to by-pass the login screen (once already logged on to the site)
Where I am stuck, is with the webpage opened, how do I continue the code to enter data into the subject box etc? I can see the box name is "subject" but it's the code to find it I am lost with.
Dim driver As New selenium.ChromeDriver
Dim ChromeLocation As String
Dim MyURL As String
Dim ws1 As Worksheet
Dim lastRow As Long
Range("A1").Select 'This contains the URLs. Using user Supamart as an example, the URL to send him a PM is https://wbaunofficial.org.uk/private.php...nd&uid=304 and that is located in cell A1
Dim ws1 As Worksheet
Dim lastRow As Long
Range("A1").Select
lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set ws1 = Sheets("rawdata")
ChromeLocation = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 'Location of Chrome.exe in your PC
For i = 1 To lastRow
MyURL = ws1.Cells(i, 1)
lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set ws1 = Sheets("rawdata")
ChromeLocation = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 'Location of Chrome.exe in your PC
For i = 1 To lastRow
MyURL = ws1.Cells(i, 1)
***************************
I know code to use if I was using the following commands
Sub TestSelenium()
Set cd = New selenium.ChromeDriver
cd.Start
cd.Get "https://www.wbaunofficial.org.uk"
But that will take me to the login page and trying to locate the login button is a nightmare with no name, id, etc etc
So... is there a way I can use the shell function as above (once logged in) and the top code runs, opens the message page and then enters the subject and message content from cells b1 & c1?
Thanking you in advance.
I'm trying to write a bit of VBS code in Excel to populate web forms
The website is similar to this one with a login and then I want to be able to send private messages
I have to use the Shell function to be able to by-pass the login screen (once already logged on to the site)
Where I am stuck, is with the webpage opened, how do I continue the code to enter data into the subject box etc? I can see the box name is "subject" but it's the code to find it I am lost with.
Dim driver As New selenium.ChromeDriver
Dim ChromeLocation As String
Dim MyURL As String
Dim ws1 As Worksheet
Dim lastRow As Long
Range("A1").Select 'This contains the URLs. Using user Supamart as an example, the URL to send him a PM is https://wbaunofficial.org.uk/private.php...nd&uid=304 and that is located in cell A1
Dim ws1 As Worksheet
Dim lastRow As Long
Range("A1").Select
lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set ws1 = Sheets("rawdata")
ChromeLocation = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 'Location of Chrome.exe in your PC
For i = 1 To lastRow
MyURL = ws1.Cells(i, 1)
lastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set ws1 = Sheets("rawdata")
ChromeLocation = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 'Location of Chrome.exe in your PC
For i = 1 To lastRow
MyURL = ws1.Cells(i, 1)
***************************
I know code to use if I was using the following commands
Sub TestSelenium()
Set cd = New selenium.ChromeDriver
cd.Start
cd.Get "https://www.wbaunofficial.org.uk"
But that will take me to the login page and trying to locate the login button is a nightmare with no name, id, etc etc
So... is there a way I can use the shell function as above (once logged in) and the top code runs, opens the message page and then enters the subject and message content from cells b1 & c1?
Thanking you in advance.



