The Quran says nothing about humans interacting with ants through spoken language.
Until, when they came upon the valley of the ants, an ant said (for females), "O ants, enter your homes so that you do not be crushed by Solomon and his soldiers while they do not feel it." (Quran 27.18)
Notice that the female ant was NOT talking to Solomon, but to the other ants, and commanding them to enter their dwelling place. This passage says absolutely nothing about a human being having a spoken conversation with an ant.
Entimologists have found that ants communicate using pheromones, sounds, and touch. The use of pheromones as chemical signals is more developed in ants than in any other hymenopteran groups. Like other insects, ants perceive smells with their long, thin, and mobile antennae.
"So [Solomon] smiled, amused at her speech, and said, "My Lord, enable me to be grateful for Your favor which You have bestowed upon me and upon my parents and to do righteousness of which You approve. And admit me by Your mercy into [the ranks of] Your righteous servants." (27:19)
Again, this verse does not indicate that an ant spoke using a human language, but rather Solomon, with the help of Allah Subhanahu Wa Ta'ala, was made able to understand and comprehend what the ant was trying to communicate. This was a one-time miracle performed by Allah Subhanahu Wa Ta'ala.