Imagine the film 9 to 5 starring Carol Burnett as office supervisor Violet Newstead and Ann-Margret as put-upon assistant Doralee Rhodes opposite Jane Fonda’s housewife turned-secretary Judy Bernly! That was the backup plan if co-producer Jane didn’t get her first-choice actors. Happily for fans of the workplace comedy, which turns 40 this year, we got Lily Tomlin and Dolly Parton in the 1980 smash hit. (It was the second-highest earning movie that year behind Star Wars: The Empire Strikes Back.) “We had such a rapport that nothing was difficult,” said Dabney Coleman, 88, who played boss Franklin Hart. “It was a perfect experience.”

It took a while for the pieces to come together, however. Jane, 82, got the idea after a friend started a women office workers’ association named, naturally, Nine to Five. “They had some great stories,” Jane said of the female workers. And at first, she imagined her film about three women and their “sexist, egotistical, lying, hypocritical bigot” boss, as Doralee calls him, to be a drama. But “it seemed too preachy, too much of a feminist line,” said Jane. So it was rewritten as a dark comedy, “in which the secretaries actually tried to kill the boss,” co-writer Patricia Resnick recalled. That didn’t fly, either.

After Jane saw Lily in her one-woman Broadway show Appearing Nitely, she saw the light. “It just absolutely knocked me off my feet and I said I’m not ever going to make a movie about secretaries unless she’s in it.” And it needed to be funny. Still, Lily took some convincing. “I was shooting The Incredible Shrinking Woman and I was so overworked,” says Lily, 81. But her wife, Jane Wagner, convinced her to do the film, and Lily suggested they hire Dabney as their boss because “there’s something sexy about him,” she says.

9 to 5

The closest Dolly had ever come to a film set was taking the tour at Universal Studios theme park, but after hearing her sing on the radio, Jane knew she’d found her Doralee. The country superstar, 74, agreed to do the film if she could write the theme music. “I remember Dolly came out on set and played the song ‘9 to 5’ for us on her fingernails,” Lily marveled. In fact, you can hear Dolly’s fingernail tapping as part of the percussion section in the song, which went on to earn an Oscar nomination and won Dolly two Grammy Awards.

“Dolly was a revelation to me,” Lawrence Pressman, 81, who played Jane’s husband in the film, exclusively tells Closer magazine in the latest issue. He says the women formed an enduring bond on the set. “They formed serious friendships that have continued to support all three of them in their various ways of dealing with being a woman in a man’s world.”

The filming went smoothly and professionally, despite the crew being “traditional,” according to Lawrence. “A crew is a pretty chauvinistic group of guys.” But there was no bad behavior on set. “With Jane there?” Lawrence says with a laugh. “Oh, my God, no! There was a really good vibe.”

The movie was so popular, 9 to 5 spun off a TV series, which aired from 1982 to ’88 (and co-starred Dolly’s sister Rachel Dennison as Doralee), and a 2009 Broadway musical with all new songs by Dolly. Despite hopes, though, a rumored sequel hasn’t materialized, which has disappointed the actors, too. “It’s like I always say, I don’t like to chew my tobacco but once,” Dolly said. “But, I would have chewed it again on that one. I still would if they came up with something.”