We derive a general obstruction to the existence of Riemannian metrics of positive scalar curvature on closed spin manifolds in terms of hypersurfaces of codimension two. The proof is based on coarse index theory for Dirac operators that are twisted with Hilbert C*-module bundles. Along the way we give a complete and self-contained proof that the minimal closure of a Dirac type operator twisted with a Hilbert C*-module bundle on a complete Riemannian manifold is a regular and self-adjoint operator on the Hilbert C*-module of L2-sections of this bundle. Moreover, we give a new proof of Roe's vanishing theorem for the coarse index of the Dirac operator on a complete Riemannian manifold whose scalar curvature is uniformly positive outside of a compact subset. This proof immediately generalizes to Dirac operators twisted with Hilbert C*-module bundles.