This paper quantitatively examines the macroeconomic and welfare effects of macroprudential policies in open economies. We develop a small open economy dynamic stochastic general equilibrium (DSGE) model, where banks choose their funding sources (domestic vs. foreign deposits) and are subject to financial constraints. Our model predicts that banks reduce leverage in response to a macroprudential policy tightening, but increasingly rely on foreign funding. This endogenous shifts of funding composition significantly undermine the stabilizing effect and welfare gains of macroprudential policies. Our results also suggest macroprudential policies are less effective in financially more open economies, and optimal policy should take capital flows into consideration. Finally, we find empirical support for the model predictions in a group of developing and emerging economies.