The basic idea of a excommunication is subject to a debate between the Beit Yoseph and the Rashbatz. The Rashbatz considers it to be in the category of איסר which has the law of neder (vow). That means it חל (-it applies) on the object and even in the case of a mitzah.
The Beit Yoseph thinks we should consider it to have the stringency of both a neder vow and a שבוע
The Magid Mishna brings an open Gemara that it has the law of a neder.