The actor also shared new details about just how close late actor James Gandolfini got to becoming the new boss at Scranton's Dunder Mifflin.

A few months after word spread that HBO paid James Gandolfini some $3 million to keep him from joining The Office, B.J. Novak has shared new details about just how close the late actor came to replacing Steve Carell's character Michael Scott — and how big an impression Galdolfini's hit crime-drama The Sopranos had on the NBC sitcom.

In an appearance this week on Watch What Happens Live, the former Office star and producer recalled taking part in the meeting in which the show's team tried to persuade Gandolfini to sign on as the new boss at Scranton's Dunder Mifflin branch.

"He was shy and intrigued," said Novak, before adding a surprising tidbit: "I just thought it would be great, because, to me, The Sopranos was actually the biggest influence on The Office because of the way that comedy and drama and character were all completely indistinguishable."

James Gandolfini, THE OFFICE
'Sopranos' star James Gandolfini nearly replaced Steve Carell on 'The Office.'
| Credit: Pascal Le Segretain/Getty Images; Justin Lubin/NBCU Photo Bank/NBCUniversal via Getty Images

Novak continued, "In fact, the way Michael Scott will say something very serious but mispronounce a word I feel is a direct descendant of the Tony Soprano sense of humor. So I thought he would've been an incredible replacement. I really, really wanted to work with him."

The actor, who played Ryan Howard on the show, also shared another head-turning fact: Gandolfini's favorite comedy was 2008's The Rocker, starring none other than Novak's old Office co-worker Rainn Wilson.

Novak said he thinks Gandolfini wanted to accept the part on The Office, but in the end James Spader was hired for season 8 to play enigmatic CEO Robert California, a role that wouldn't have lined up with what The Sopranos star thought best suited him.

"We suggested a white-collar character for him to play against type," Novak explained. "And he said something I'll never forget, which is, 'I feel as an actor, whoever comes out at 3 a.m., that's who you should be playing. And at 3 a.m., what comes out of me is a blue-collar guy.' I thought that was so interesting."

Gandolfini's son, Michael, can currently be seen playing teenage Tony Soprano in the Sopranos prequel film, The Many Saints of Newark, in theaters and on HBO MAX today.

While participating in EW's Around the Table with his Newark castmates, the younger Gandolfini shared how "proud" he was of his late father after finally watching The Sopranos for the first time.

Watch the clip of Novak above.

Sign up for Entertainment Weekly's free daily newsletter to get breaking TV news, exclusive first looks, recaps, reviews, interviews with your favorite stars, and more.

Related content: