I hope this question is not completely trivial:
Suppose $V$ is an irreducible projective variety and $U\subset V$ is a Zariski open subset isomorphic to an affine variety. Is it true that $V\setminus U$ is a Cartier divisor in $V$? If not, what conditions should we impose on $V$? (I guess if $V$ is smooth, then everything is fine?)