Sondheim was speaking at the National Theatre's platform, hosted by Jeremy Sams, who asked whether Sondheim had ever said no to a director who wanted to stage one of his pieces.
"I will tell you," Sondheim commented, "John Tiffany, who is one of the most inventive and brilliant directors around, he really wanted to do an all-male version of Company. There's always talk about if Bobby is gay or not (he isn't)… [Tiffany] said he'd like to do an all-male version.
"I said OK, let's do a reading of it, and it didn't work, because it wasn't written that way."
Sondheim added that Tiffany's suggestion was 'just another way of looking at the piece'.
"It's an idea that Tiffany didn’t suggest to serve himself, it was just another way of looking at the piece. I went along with it and it just didn’t work," he said.
During the evening, Sondheim mentioned the fact that Marianne Elliott is due to direct a version of Company where Bobby is a woman.
He said: "There is going to be a production of Company directed by Marianne Elliott, one of the best directors in the world, in which Bobby is a woman. I think there may be a same sex couple in there too, but she has a point she wants to make about women today.
"If it doesn't work, it's not going to kill Company…to me, [the gender change] is exciting."
When asked about why Follies, which has opened in previews at the National Theatre this week, was first staged after Company, despite having been written before it, Sondheim said: "Hal [Prince] very much wanted to do Company. He said, 'I'll do Follies, but I want to do Company first'. So Follies had been written, and in order to get Hal we did Company first."
Sondheim also threw light on how hard it is to cut songs from his shows. "Oscar Hammerstein was the one who taught me how to be ruthless about songs."
Follies runs at the National Theatre until January 2018.