Hi experts!
I have a text box on a slide that I'm trying update every 4 seconds with the results of some XML.
When I step through this, the code works fine. However, when I run it on a page change, it "hangs", returning control to me after the code has executed, but without updating my text box. Any ideas? Here is the code:
Sub updateNews()Dim XDoc As MSXML2.DOMDocument
Dim xDetails As MSXML2.IXMLDOMNode
Dim xParent As MSXML2.IXMLDOMNode
Dim xChild As MSXML2.IXMLDOMNode
Dim Col, Row As Integer
Set XDoc = New MSXML2.DOMDocument
Set tb = ActivePresentation.Slides(1).Shapes("txtNews")
XDoc.async = False
XDoc.validateOnParse = False
XDoc.Load ("http://feeds.findlaw.com/FindLawsCommonLaw?format=xml")
Set xDetails = XDoc.DocumentElement
Set xParent = xDetails.FirstChild
Row = 1
Col = 1
For Each xParent In xDetails.ChildNodes
For Each xChild In xParent.ChildNodes
If Mid(xChild.nodeName, 1, 5) = "title" Then
tb.OLEFormat.Object.Text = xChild.Text
Sleep 4000
End If
Col = Col + 1
Next xChild
Row = Row + 1
Col = 1
If Row = xDetails.ChildNodes.Length Then
Set xParent = xDetails.FirstChild
End If
Next xParent
Set XDoc = Nothing
End Sub
Thanks for your help!!