The purpose of this paper is to examine the long-run effects of trade openness on FDI for 124 developed and developing countries over the period 1996-2021. The econometric specification adopted is the ARDL model in Panel. The main results estimate that, for developed and developing countries, trade openness has a positive and significant long-run effect on FDI inflows; the long-run effect is more important for developing countries (8-13 times that of developed countries). For developing countries, the long-run effect of trade openness on FDI is greater than that of infrastructure quality (from 6.6 to 10 times). For all samples (whole, developed and developing countries), the short-run effects are insignificant. The results estimate, also, a bidirectional causality between trade openness and FDI for whole sample and for developed countries. In the light of these results, it is recommended for the government to make several strategies to attract trade: Reduce barriers for products and services, more transparency, reduce bureaucracy, create a good politic and economic environment, develop institutions, improve infrastructure and specially communication and technology.