It still doesn't work it seems that the contentcontrol checkbox i want to delete through this code is bothering it. Without the contentcontrol checkbox it deletes it with the code i wrote in my first post. But once i add the contentcontrol checkbox it just skips the code and goes to the contentcontrol checkbox.