When the office of sheriff is vacant and until his successor qualifies, when the sheriff is imprisoned, in cases to which he is a party, in cases in which he is interested or for any legal cause is incompetent to act, if such interest or cause appears on the face of the proceedings, the execution must be directed to, and executed by, the coroner or special coroner, as the case may be.