Hi, I have this simple code that suddently stopped working, it is used to erase all the objects on a specific layer, I have the error, Invalid argument Items in Removeitems Set Sset = Nothing Set Sset = ThisDrawing.PickfirstSelectionSet Sset.Clear ft(0) = 8 ' layer name ThisDrawing.Utility.GetEntity ent, pt, "Choisit un objet:" nomLay = ent.layer Sset.Clear fd = Array(nomLay) Sset.Select acSelectionSetAll, , , ft, fd If Sset.count > 0 Then ThisDrawing.Utility.Prompt ("Efface le layer : " & nomLay & vbCr & vbLf) For Each ent In Sset If TypeName(ent) <> "IAcadPViewPort" Then *******The error occurs here : Sset.RemoveItems ent ent.Delete End If Next End If