aletri
Goto Top

Vbscript Fehlercode: Object required

Guten Morgen
seh vor lauter Bäume den Wald nicht mehr!
bei Ausführen des Cods kommt folgende Fehlermeldung: Line:9
Char:1
Error: Object requred: 'Groups'
Code: 800A01A8

Set xmlDoc = CreateObject("MSXML2.DOMDocument.6.0")  
xmlDoc.async = False
xmlDoc.load("C:\zATi\AutogenDescriptions.xml")  
Set xmlRoot = xmlDoc.documentElement
Set nodeInsert = xmlDoc.selectSingleNode("//Autogen.AutogenGroupings")  

Set rootElement=xmlDoc.createElement("Groups.Grouping")    

Set Groups.GroupingAttribute=xmlDoc.createAttribute("id")    
Set Groups.GroupingAttributeText=xmlDoc.createTextNode("{xxxxxxx}")   
Groups.Grouping.appendChild(Groups.GroupingAttributeText)  
RootElement.setAttributeNode(Groups.GroupingAttribute) 
 
Set objFieldValue = _
  xmlDoc.createElement("ATi")  
objFieldValue.Text = "_Follunga"  
rootElement.appendChild objFieldValue

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxxxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxxxxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxx"  
objRecord.appendChild objFieldValue

Set objFieldValue = _
  xmlDoc.createElement("RelativeWeight")  
objFieldValue.Text = "xxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

Set objRecord = xmlDoc.createElement("ReferenceEntry")  

Set objFieldValue = _
  xmlDoc.createElement("TargetGuid")  
objFieldValue.Text = "xxxxxxxxxxxxxxxxxx"  
objRecord.appendChild objFieldValue

rootElement.appendChild objRecord
nodeInsert.appendChild rootElement

xmlDoc.Save"C:\zATi\TestAutogenDescriptions.xml"  
Set xmlDoc = Nothing
Besten Dank für Hilfe

Content-ID: 340492

Url: https://administrator.de/contentid/340492

Ausgedruckt am: 24.11.2024 um 09:11 Uhr

emeriks
Lösung emeriks 13.06.2017 um 09:45:19 Uhr
Goto Top
Hi,
ja, ist sonnenklar. face-wink

Hast das Objekt "Groups" noch nicht definiert. Da ist kein "Set Groups = ...." vorher. Also kannst Du auch noch nicht auf "Groups.GroupingAttribute" referenzieren.

E.
aletri
aletri 14.06.2017 um 14:52:30 Uhr
Goto Top
hi emeriks

danke bestens ...funktioniert

gruss
aletri