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-Key: 340492

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

Printed on: April 25, 2024 at 13:04 o'clock

Member: emeriks
Solution emeriks Jun 13, 2017 at 07:45:19 (UTC)
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.
Member: aletri
aletri Jun 14, 2017 at 12:52:30 (UTC)
Goto Top
hi emeriks

danke bestens ...funktioniert

gruss
aletri