So here's a story.... of a lovely lady.....
Okay so I am using VBA to automate a webpage and everything over all is running smoothly.. however, there are a couple elements that are disabled in the html... causing a delay, and many headaches.
This is the the html element I am trying to run code against...
Code:
<input name="FullName" disabled="disabled" class="tTextBox" id="FullName" onblur="checkName(this.value,event)" type="text" size="30"/>
And here is the code that I am trying to put against it.
Code:
oIE.Document.Frames(1).Document.all.Item("FullName").Value = "Lastname, Firstname"
So if the textbox is in the disabled state, I cannot make any changes to it... So I have the code doing this in the error handler...
Code:
If Err.Number = 438 And Check = True ThenDebug.Print Cnt & " " & Err.Number & " " & Err.Description & " " & Erl
Cnt = Cnt + 1
If Cnt > 6000 Then End
Resume
Else
Debug.Print Cnt & " " & Err.Number & " " & Err.Description & " " & Erl
End If
So when I hit these elements that are disabled, I know how many times the code is attempting to enter a value... it is usually anywhere between 600-1500 attempts..
Eventually the element's html is updated and looks like this,
Code:
<input name="FullName" class="tTextBox" id="FullName" onblur="checkName(this.value,event)" type="text" size="30" value="Lastname, Firstname"/>
And the code will change the value or do whatever we need with it..
So the question is....
Has anyone here had to change an IE element from disabled to not? How can it be done? I've tried things like...
oIE.Document.Frames(1).Document.getElementById("Fu llname").disabled = Null
oIE.Document.Frames(1).Document.getElementById("Fu llname").disabled = false
oIE.Document.Frames(1).Document.getElementById("Fu llname").disabled = "false"
All of these go thru, don't raise in errors.. but are not actually changing the element status.
Any ideas?