Run time error 91 - Object variable or With block variable not set- updating XML from Excel -
i getting run time error 91 - object variable or block variable not set when trying update , xml using excel vbscript
sub updatexml() call fnupdatexmlbytags end sub function fnupdatexmlbytags() set xmldoc = createobject("microsoft.xmldom") xmldoc.load "f:\xml\xml1.xml" omsgid = "15544216089s01f15544100002396000002" set nmsgid = xmldoc.selectsinglenode("//acctswtchbtch/grphdr/msgid") nmsgid.text = omsgid strresult = xmldoc.save("f:\xml\xml1.xml") end function
a function must return something. example:
function fileexists(filepath string, filename string) boolean dim currentdir string currentdir = curdir ' used set curdir if filepath <> "" chdir filepath if dir(filename) <> "" fileexists = true else fileexists = false end if chdir currentdir end function
i suggest changing function sub.
Comments
Post a Comment