Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:22:06+00:00 2026-06-11T10:22:06+00:00

Everything in this little VBS script works right up until I reach the last

  • 0

Everything in this little VBS script works right up until I reach the last line of code indicated below. Upon reaching that line the script throws the error “incorrect parameter 80070057.

After spending a great deal of time googling it turns out that the error code means roughly the same thing, incorrect parameter.

'section 15
Set lots = xmlDoc3.selectNodes("ArrayOfLot/Lot")

For Each lot in lots
    Dim nl: Set nl = lot.cloneNode(true)
    xmlDoc4.documentElement.appendChild nl
Next

xmlDoc4.save xmlDoc4.url 'this code works

'**************************************************************************
'section 16 
Set lots = xmlDoc5.selectNodes("ArrayOfLot/Lot")

For Each lot in lots
    Dim nll: Set nll = lot.cloneNode(true)
    xmlDoc6.documentElement.appendChild nll
Next

xmlDoc6.save xmlDoc6.url 'this does not work - error thrown

It is really frustrating because the .save works just 8 lines above that. Does anyone have any insight to what my problem may be and how I can solve it?

Based on the answer below I am posting the code where all of the document information gets declared:

Dim xmlFilePath6: xmlFilePath6 = "section16.xml"
Dim xmlDoc6: set xmlDoc6 = CreateObject("MSXML2.DomDocument")
xmlDoc6.async = "false"
xmlDoc6.load xmlFilePath6

This actually gets done for 6 different documents, subbing the 6 for one of the other digits 1-8. I’m still puzzled because section16.xml exists and no error is thrown on load.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:22:08+00:00Added an answer on June 11, 2026 at 10:22 am

    UPDATE: I adjusted my code so that xmlDoc6 is no longer associated with a file and I have reproduced your error:

    demo.vbs(67, 1) msxml3.dll: The parameter is incorrect.
    

    To reproduce your error, instead of this:

    xmlDoc6.load "xmlDoc6.xml"
    

    …I initialized xmlDoc6 this way:

    xmlDoc6.loadXML xmlText
    

    Hunch: Make sure that xmlDoc6 is associated with a file. If it is not, the value of xmlDoc6.url will be the empty string.


    ORIGINAL: I have written a complete program to illustrate your use case. However, I am not getting the incorrect parameter error that you report when attempting xmlDoc6.save xmlDoc6.url. But perhaps something in my program will stand out that will lead you to a solution.

    For anyone interested, to run this program, copy the text to a file named say, demo.vbs, and then run it via:

    cscript demo.vbs
    

    The output to the console should look something like this:

    Creating XML documents 3 through 6.
    Saving file:///c:/Users/DavidRR/temp/xmlDoc4.xml
    Saving file:///c:/Users/DavidRR/temp/xmlDoc6.xml
    Done.
    

    ' demo.vbs - Use MSXML to edit and save multiple XML files.
    
    Option Explicit
    
    Dim xmlText : xmlText = "" _
        & "<?xml version='1.0' encoding='utf-8'?>" _
        & "<ArrayOfLot>" _
        & "  <Lot>" _
        & "    Lot One" _
        & "  </Lot>" _
        & "  <Lot>" _
        & "    Lot Two" _
        & "  </Lot>" _
        & "  <Lot>" _
        & "    Lot Three" _
        & "  </Lot>" _
        & "</ArrayOfLot>" _
        & ""
    
    WScript.Echo "Creating XML documents 3 through 6."
    
    Dim  xmlDoc3 : Set xmlDoc3 = CreateObject("Msxml2.DOMDocument")
    Dim  xmlDoc4 : Set xmlDoc4 = CreateObject("Msxml2.DOMDocument")
    Dim  xmlDoc5 : Set xmlDoc5 = CreateObject("Msxml2.DOMDocument")
    Dim  xmlDoc6 : Set xmlDoc6 = CreateObject("Msxml2.DOMDocument")
    
    xmlDoc3.loadXML xmlText
    If xmlDoc3.parseError.errorCode <> 0 Then
        WScript.Echo "Couldn't load xmlDoc3: " & xmlDoc3.parseError.reason
        WScript.Quit(1)
    Else
        ' WScript.Echo "Loaded XML [" & xmlDoc3.documentElement.xml & "]"
    End If
    
    ' WScript.Echo xmlDoc3.Xml
    xmlDoc3.save "xmlDoc4.xml"
    xmlDoc3.save "xmlDoc5.xml"
    xmlDoc3.save "xmlDoc6.xml"
    
    xmlDoc4.load "xmlDoc4.xml"
    xmlDoc5.load "xmlDoc5.xml"
    xmlDoc6.load "xmlDoc6.xml"
    ' xmlDoc6.loadXML xmlText
    ' WScript.Echo "xmlDoc6.url = [" & xmlDoc6.url & "]"
    
    ' section 15
    Set lots = xmlDoc3.selectNodes("ArrayOfLot/Lot")
    ' WScript.Echo lots.length
    
    Dim lot, lots
    For Each lot In lots
        Dim nl: Set nl = lot.cloneNode(True)
        xmlDoc4.documentElement.appendChild nl
    Next
    
    WScript.Echo "Saving " & xmlDoc4.url
    xmlDoc4.save xmlDoc4.url 'this code works
    
    '**************************************************************************
    ' section 16
    Set lots = xmlDoc5.selectNodes("ArrayOfLot/Lot")
    
    For Each lot in lots
        Dim nll: Set nll = lot.cloneNode(true)
        xmlDoc6.documentElement.appendChild nll
    Next
    
    WScript.Echo "Saving " & xmlDoc6.url
    xmlDoc6.save xmlDoc6.url ' reportedly does not work...but it works here.
    
    Set xmlDoc6 = Nothing
    Set xmlDoc5 = Nothing
    Set xmlDoc4 = Nothing
    Set xmlDoc3 = Nothing
    
    WScript.Echo "Done."
    
    ' End
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I implemented this Jquery show/hide code and everything works fine except that the box
I've this little method which is supposed to be thread safe. Everything works till
This might get a little confusing as I have tried everything to make this
I tried everything to get this code working, and I hope someone will save
Currently I use this little snippet of code to get my java server up
So i'm using this plugin https://github.com/podio/jquery-mentions-input for my comment system, everything works fine but
Given this little piece of code : #include <iostream> #include <assert.h> using namespace std;
First off: Everything works , but I would like to fine tune this a
sorry, if this gets a little complicated. I've taken the object and removed everything
I've searched for help and tried everything on this thread , but still can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.