Visual Basic for Applications (VBA)


SelectSingleNode fails with MSXML2.DOMDocument60 but not with MSXML2.DOMDocument26 and below


I have a webservice that returns the following XML:
 
 
Code Snippet
<CntrDatePriority xmlns="http://myproject.mycompany.com"> <ContractualShipDate>10/31/2008</ContractualShipDate> <Priority>Normal</Priority></CntrDatePriority>
 
 
When I attempt to retrieve the ContractualShipDate as below in my Access 2003 ADP VBA, I get no ParseError. But I get the dreaded and much disliked -  "Object variable or With Block Variable Not Set" error.
 
Code Snippet
 
Dim xmlResult As New MSXML2.DOMDocument60
Dim objNode As IXMLDOMNode
xmlResult.LoadXml (MyWebServiceObject.WebMethod())
Set objNode = xmlResult.documentElement.selectSingleNode("ContractualShipDate")
ProdDate = objNode.Text
 
 
It fails even with MSXML2.DOMDocument40.
 
However it works for MSXML2.DOMDocument and MSXML2.DOMDocument26
 
Please help me understand this. Thank you.
Please Check your reference items in VBE.(tools--references--refereneces dialogs box)
And what is your IE version?
So, I thought there were two possible situations:
1. if you set the reference: Microsoft XML, v2.6 or v3.0
2. if your IE is too old to suport v4.0 or above
 
 
 
Thank you for responding.
 
IE version is 7, OS - XPSP2 with all the latest service packs and updates.
Access 2003.
 
I set the reference to MS XML 6. 
You get any solution for this query.I change my reference to ms xml 6 is there any disadvantage.Rgrds,
Brijraj Rathod
http://accessvbadeveloper.wordpress.com

Related Links

Method range of object_Worksheet failed???
Adding text labels to points on a chart.
Is it possible to set project references at run-time?
Using a condition of =H1<H2 or =H1>H2, How to format H1 instead of H2?
Conditionally formatting a looped range of cells based on value in other cell in VBA
How to get the List of Visible Items from a Pivot Field using VBA
How to run a macro when a Filter is applied on Particular Pivot Field
Add a new property to an existing object
How to Allocate Input Numeric digit to Concerned Numeric header Column
Range referencing in Copy and Paste Formats
VBA6 trouble in WINDOWS 10
VBA dynamic formula reference
Printing Userform
Sorting and selecting cells based off name.
How to tune auto filter option for our need???
VBA Loggin into secure websites

Categories

MSDN
Using Forums
Visual Studio Languages
Windows Phone Development
Visual Studio Design a...
Development
Microsoft Research
Office Live Development
Archived Forums X-Z
OneDrive Development
Internet of Things
Where is the Forum For…?
Visual Studio Setup an...
Application Insights (AI)
XboxLiveDevelopment
General Windows Deskto...
Peer-to-Peer Networkin...
Windows Desktop Perfmo...
SharePoint 2010 - Gene...
SharePoint 2010 - Deve...
SharePoint Legacy Vers...
Azure Management Portal
Azure DocumentDB
Azure Key Vault
Azure Mobile Engagement
Azure App Service - AP...
Azure Disk Encryption
Publishing Apps for th...
Common Language Runtim...
Team Foundation Server...
The Architect Role
Commerce Server 2009
Code Contracts
TPL Dataflow
Microsoft Robotics - C...
SQL Server Analysis Se...
SQL Server XML
SQL Server Documentation
SQL Server Setup & Upg...
SQL Server Samples and...
SQL Server Master Data...
SQL Server PowerPivot ...
SQL Server Data Tools
Standard 7: Components...
SQL Server 2012 Setup ...
SQL Server 2012 Spatia...
SQL Server 2012 Report...
Windows Forms Data Con...
MSDN, TechNet and Expr...
Orchard –Discussions
WebsitePanel - Develop...
The Samsung Windows De...
Exchange Server Protocols
SQL Server Protocols
Project Server General...
Microsoft Lync Server ...
Report a Silverlight Bug
PivotViewer Control wi...
Surface Application De...
Retired InfoPath Forms...
Retired SharePoint Wor...
.NET Framework 4 Appli...
Acropolis
Building Windows Store...
Commerce Server 2002 a...
Expression Community S...
Game Technologies: Gen...
LightSwitch in Visual ...
Microsoft adCenter: De...
Microsoft Unified Comm...
Network Class Library ...
Office Live Small Busi...
Office Live Small Busi...
SyncFx - Technical Dis...
SQL Server 2014 In Azu...
SQL Server 2014 Integr...
Team Foundation Server...
Team Foundation Server...
Tellme Studio (retired)
Using Visual Round Tri...
Tools for Windows Stor...
Visual Studio Team Ser...
Visual Studio Class De...
Visual Studio Database...
Visual Studio Lab Mana...
Visual Studio Web Perf...
Building Windows Store...
OneDrive Development (...
Azure N-Series Virtual...
Windows IoT
Skype Web SDK
Cortana Skills Kit

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile