Henry IV wanted to keep lay investiture around, that is the appointing of bishops and priests by lay people. Gregory VII however said that it was to be stopped and when Henry IV ignored him, he interdicted all of Henry IV's kingdom, that means he and all of his citizens were excommunicated. Everyone hated Henry IV until he was forgiven and the interdiction was lifted.