Flatworm eXit (by Salifert) does not appear to be harmful to a reef tank. The danger is in having too many flatworms where the toxins from the dying fw cause the damage. Some people have dosed 3X the amount and had no problems.
But, if you think you have tons of the things, I'd split up the display: set up a q-tank to treat your corals separately, then treat the main tank as well - the flatworms bury themselves in the sand so you're not likely to get them any other way. Also I'd remove the fish just to be sure.
You can do a search and you'll get tons of info
Good luck