vb script xmldom

Posted on 2011-04-26
Last Modified: 2012-05-11
The following code fails on Line 22 where I am returning the loaded xml document back to the operational code.  Is this a limiation of vb script, not being able to pass an xmldom object back from a function?  If not a limitaition of vb script, how do I code so xml doc is returned and able to be parsed in the operational code?

Other info:  This is used in a proprietary work flow designer for an ERP system.  
The scripting window in the work flow designer is vb script based.
dim template
set template = CreateObject("Microsoft.XMLDOM")

template = RetrieveTemplate
msgbox template

Function RetrieveTemplate()

	dim xmltemplate
	set xmltemplate = CreateObject("Microsoft.XMLDOM")
	xmltemplate.async = false

	file = "http://training7i/ifas7/workflow/custom/POPRRCFM/xml/seedrequestPOUPPR.xml"
	xmltemplate.load file
	msgbox xmltemplate.xml  'this works ok
	RetrieveTemplate = xmltemplate  'this fails

End Function

Open in new window

Question by:KeithMcElroy
    1 Comment
    LVL 82

    Accepted Solution

    xmltemplate is an object, so you need the keyword Set before the "receiver" - line 21:
    Set RetrieveTemplate = xmltemplate  'this fails

    the same goes for line 5.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now