![]() |
|
#6
|
||||
|
||||
|
Hi tinfanide,
I'm not familiar with IE automation. However, when I test your funnction with: Code:
Sub Test() GetElementsByClassName1 "pronunciation", "dog" End Sub 'Set html = IE.Document' after the 'Loop' line. Speaking of which your 'Do Until ... Loop' should have a 'DoEvents' statement, like: Code:
Do Until IE.readyState = READYSTATE_COMPLETE DoEvents Loop Your code would also be more efficient with: Code:
Result = Array(0)
For Each tag In tags
If tag.className = cName Then
Set Result(0) = tag
Exit For
End If
Next tag
GetElementsByClassName1 = Result(0).getElementsByTagName("div")(0).innerText
Code:
For Each tag In tags
If tag.className = cName Then
GetElementsByClassName1 = tag.getElementsByTagName("div")(0).innerText
Exit For
End If
Next tag
PS: I'm moving the thread to the Excel forum, as you've posted in the Word vba forum and your attachment shows this is really for Excel.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to edit the "Format" and the "show level" of an EXISTING table of content? | Jamal NUMAN | Word | 2 | 08-14-2011 10:46 AM |
Word 2003 document suddenly "locked for editing" by me
|
lisa801 | Word | 3 | 07-08-2011 10:11 PM |
"Table of content" based on "Normal Style" behavior!!!!
|
Jamal NUMAN | Word | 4 | 07-08-2011 04:12 AM |
How to choose a "List" for certain "Heading" from "Modify" tool?
|
Jamal NUMAN | Word | 2 | 07-03-2011 03:11 AM |
| "Microsoft Excel Application" missing in the "Component Services" on win08 | sword.fish | Excel | 0 | 02-26-2010 02:09 PM |