"A bomb squad is investigating a bag containing cables that the man was carrying while he tried to enter the building, but it is doubtful whether there were explosives inside," Istanbul Governor Muammer Guler said.
"The attacker was taken to a nearby hospital and he is not in a critical condition," he added
The governor said the 29-year-old man, whose wife was living in the Ukraine, tried entering the consulate at around 9 a.m. (0700 GMT), and began firing randomly, before he was shot by a guard.
"It seems that it is not a terrorist attack," Istanbul Police Chief Huseyin Capkin said.
Turkish police evacuated buildings near the Ukrainian Consulate.