there is a bit of code I have written, which works on my pc, but doesnt work on someone elses. I am really confused.the code in question is
r is a range object that is passed to the sub.
the variable html is an object that has been loaded with html from a webpage.
This code works fine on my pc, it finds the "option" tags in the html source , and then checks to see if the "value" attribute is equal to the string s. When I run it on someone elses pc , temp.getAttribute("value") returns a blank string, even though there is an attribute called value. The web page address is hard coded so its not that hes using the wrong URL
I use excel 2007, he uses 2010
Anyone got any ideas?
thanks
Code:
[COLOR=blue]Dim[/COLOR] temp [COLOR=blue]As[/COLOR] HtmlHtmlElement [COLOR=blue]
Dim[/COLOR] s [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR]
s = "2222222"
[COLOR=blue]For Each[/COLOR] temp [COLOR=blue]In[/COLOR] html.getElementsByTagName("option") [COLOR=blue]
If[/COLOR] temp.getAttribute("value") = s [COLOR=blue]Then[/COLOR]
r.Offset(0, 1) = (temp.innerText) [COLOR=blue]
End[/COLOR] [COLOR=blue]If[/COLOR] [COLOR=blue]
Next[/COLOR] temp
the variable html is an object that has been loaded with html from a webpage.
This code works fine on my pc, it finds the "option" tags in the html source , and then checks to see if the "value" attribute is equal to the string s. When I run it on someone elses pc , temp.getAttribute("value") returns a blank string, even though there is an attribute called value. The web page address is hard coded so its not that hes using the wrong URL
I use excel 2007, he uses 2010
Anyone got any ideas?
thanks