Gregory had many enemies in the higher ranks of the German clergy, so Henry IV declared that Gregory was no longer pope and that the Romans should choose a new pope . When Gregory learned of this he excommunicated Henry IV, declared he was no longer emperor, and told his subjects that they no longer had to obey him as they had sworn to do.