Showing results for 
Search instead for 
Did you mean: 

VB Script to Remove an Object Error

Occasional Contributor

VB Script to Remove an Object Error



I am trying to write a simple script to disconnect one object from another object but I receive the following error;


Script Editor Default : Object Deletion Error line 16, offset 10 :
Error(0x800aa200) : Object  ~odAkCZBsq400{MetaClass}[External reference] : Error, updating not possible


My code is below - am I doing something wrong or is this a permissions error?  Any help would be greatly appreciated.



Set oRoot = object.GetRoot

  Set oExtRefs = oRoot.GetSelection("Select [External Reference] Where [Operation]'")

  For Each oExtRef in oExtRefs

  oExtRefName = oExtRef.GetProp("Short Name")

      Set oOperations = oRoot.GetSelection("Select [Operation] Where [External Reference].[Short Name] Like '" & oExtRefName & "'").Item(1)

              For each oOperation in oOperations

                  oExtRef.Remove oOperation