Assume we have an affine scheme $A$ that comes with a closed immersion into a smooth scheme $i \colon A \hookrightarrow M$, which is not necessarily affine. 


Does there exist an affine open subscheme $j \colon V \hookrightarrow M$ such that $A$ already embeds in $V$?


Expressed in Diagrams, does there exist an affine open subscheme $V$ of $M$ such that we have a factorization



```

     i
A (----> M
 \      /
  \    /
     V ?

```


Does a closed immersion of an affine scheme in a smooth scheme factor over an open affine subscheme?
Let me expand on my comment. Let $E$ be an elliptic curve and let $p$ be a point of $E$ of infinite order. Embed $E$ in $\mathbb{P}^2$ as a plane cubic using the linear system $3O$, where $O$ is the origin of the group law. Remove from $\mathbb{P}^2$ the image of the point $p$ and note that $E \setminus \{p\}$ is affine. The inclusion of $E\setminus\{p\}$ in $\mathbb{P}^2 \setminus \{p\}$ is the required counter-example. Indeed, it is a closed immersion and if there were an affine open subset of $\mathbb{P}^2 \setminus \{p\}$ containing $E\setminus\{p\}$, then there would be a plane curve intersecting $E$ in only the point $p$. This is impossible, since the point $p$ has infinite order.


