Real president Florentino Perez attempted several times to land Vieira while he was with the Gunners.
The Manchester City chief recalled: "We never closed. Sometimes in football things happen or not happen, it is the path taken. Maybe it was not the time for me to go. I've spoken many times with Florentino Perez, with whom I have very good relationship.
"Actually I do not know how many times I've been close to Real Madrid."
He added: "Now that my career is over, it is an honor to see that Madrid wanted me, because when Madrid goes for a player it means you're a great player."