Hi,
I'm trying to use excel to update a webpage for work. It's a shared webpage that is basically a Checklist that the owner of that task will fill in confirming that their part of the process is complete. Once this is done by the owner, the supervisor of the owner's group would need to go in and click the Radio Button to either Approve or Reject. There are a ton of Radio Buttons that need to be clicked, so I was able to get this part to work, but for ALL radio buttons.
I'm sure (nay, certain) below is the long way of doing it, but this part of the code has been working, and just clicks approve on all of the radio buttons.
Sub Checklist()
Set oIE = CreateObject("InternetExplorer.Application")
For Each oIE In CreateObject("shell.Application").Windows
If InStr(1, oIE.LocationURL, "internal website here") > 0 Then
'If InStr(1, oIE.LocationURL, "internal website here") > 0 Then
oIE.Visible = True
On Error Resume Next
oIE.Document.getElementsByName("ctl00$ContentPlaceHolder1$dgReports$ctl02$gnVerify").Item(0).Click
oIE.Document.getElementsByName("ctl00$ContentPlaceHolder1$dgReports$ctl03$gnVerify").Item(0).Click
oIE.Document.getElementsByName("ctl00$ContentPlaceHolder1$dgReports$ctl04$gnVerify").Item(0).Click
oIE.Document.getElementsByName("ctl00$ContentPlaceHolder1$dgReports$ctl05$gnVerify").Item(0).Click
Etc...
My problem now is that I only would like to have the macro click Approve when someone from my group completes the job. So, say there are 10 steps in the process. Steps 1-5 are done by Tim, steps 6-8 are done by Joe and steps 9 & 10 are done by Mike.
Is there a way that I can get the code to only click the radio buttons for just Tim? I thought maybe an If statement would work, but I can't get it to work. I didn't get very far with it, but it was still Appproving all of them or just skipping all of the radio buttons.
When I look at the JavaScript, this is the part where I see the name of the owner who completed the task.
<span id="ctl00_ContentPlaceHolder1_dgReports_ctl03_lbAuditValue1Name">Tim</span>
Thanks in advance for your help!
Moderator Note:
Pls use code tags around your code next time as per forum rules.
Bookmarks