Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-29-2011, 08:43 AM
tinfanide tinfanide is offline XML parsing & Object variable not set (Error 91) Windows 7 64bit XML parsing & Object variable not set (Error 91) Office 2010 32bit
Expert
XML parsing & Object variable not set (Error 91)
 
Join Date: Aug 2011
Posts: 310
tinfanide is on a distinguished road
Default XML parsing & Object variable not set (Error 91)


Unknown error:
Object variable not set (Error 91)

Even after looking at the help document, I cannot figure out why the codes are wrong:

xmlParsing-error(ObjectVariableNotSet).zip
Please see my attachment. Thanks!

Code:
Sub loadXML()

Dim xmlDoc As MSXML2.DOMDocument
Set xmlDoc = CreateObject("MSXML2.DOMDocument.3.0")
xmlDoc.Load ("C:\Users\Tin\Desktop\teacher_halloween.xml")

Dim r As Integer
r = 1
Do
For v = 0 To xmlDoc.getElementsByTagName("Value").Length Step 3
    Cells(r, 1).Value = xmlDoc.getElementsByTagName("Value")(v).Text
    r = r + 1
Next v
Loop Until r = xmlDoc.getElementsByTagName("Time").Length - 1

Set xmlDoc = Nothing
End Sub
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML parsing & Object variable not set (Error 91) Application-defined or Object-defined error Manit Excel Programming 4 12-08-2011 07:35 PM
Multi-Variable Lookup help ebolton Excel 8 05-05-2011 05:28 AM
Variable fields? Emalee77 PowerPoint 0 01-30-2011 05:58 PM
Problem: object library invalid or contains references to object definitions aligahk06 Office 0 08-19-2010 12:29 PM
Could not load this object as this object is not present in your computer k.gaurav Office 0 08-17-2009 09:57 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 08:45 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft