The coach has explained that they were close to finalising an agreement with the Rossoneri for the Brazil international, who was keen on returning to the Vila Belmiro
The Club World Cup runners-up had been optimistic about their chances of bringing the Brazil international back to Vila Belmiro.
However, Ramalho explained that the Rossoneri are no long willing to sell the attacker now that they have balanced their books by cashing in on Ibrahimovic and Thiago Silva.
"The deal was being made," the coach told Terra. "But the sale of both players complicated things. If they had stayed it would have turned out differently.
"We were not far apart [in terms of a fee], the effort was great. But Milan did not want to complete the deal and now we know that it will not happen."
Robinho, who has been capped 90 times by the Selecao, made his name at Santos before moving to Real Madrid in 2005.