Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

AppendChild gives Error 438

AppendChild gives Error 438

In my Dictionary I have several DOMDocuments. These are taken out of the dict with XMLDocAOHA. To append this document to a Node I have to convert the DomDocument to an IXMLNode. I'm using Xpath to do this.

Then I am adding the new XMLNode to XMLNodeBasisBody, but then I get Error 438. What causes this error?


If dicNummerAanduidingen.Exists(strHoofdAdres) Then
  'as DomDocument
  Set XMLDocAOHA = dicNummerAanduidingen.Item(strHoofdAdres)
  'add to body, casted to node. doc is not ok
  ' selectsinglenode returns a node
  Set XMLNode = XMLDocAOHA.selectSingleNode("/")
  'As DomNode
  Set XMLNode = dicNummerAanduidingen.Item(strHoofdAdres)
  XMLNodeBasisBody.appendChild (XMLNode)
  Err.Raise 32001, "Samengesteld.maakSamengesteldBericht", "No Hoofdadres found for " & strHoofdAdres
End If

(I have translated the comments to English)

Yes, the world is full of strange people.

RE: AppendChild gives Error 438

When trying to append the 438-Error is thrown, but my XMLNode is appended to my XMLNodeBasisBody. So I have put On Error Resume Next above it, so it does not bother me again, and again, and again, and again......

Did anyone else have this problem?

Yes, the world is full of strange people.

RE: AppendChild gives Error 438

Just to know, what is the error message ?

RE: AppendChild gives Error 438

[1] You have two different lines defining XMLNode. The second line, I do not recognize what it is. In any case, these methods Exists(), Item() in your context, are they proprietary?

[2] This is just a beautiful misunderstanding if XMLDocAOHA is a DOMDocument:
>Set XMLNode = XMLDocAOHA.selectSingleNode("/")
XMLNode is exactly the same as XMLDocAOHA, a DOMDocument. It is not any other type.

[2.1] If you want to append it, use this definition should do.
>Set XMLNode = XMLDocAOHA.selectSingleNode("/")
Set XMLNode = XMLDocAOHA.DocumentElement

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close