Though he’s now having the time of his life boogying around the dance floor on Dancing With the Stars, Robert Herjavec recently opened up about a dark time when he considered committing suicide.

“I just wanted to end it,” the 51-year-old tech mogul told ‘People‘ of a night last July when he found himself contemplating jumping off the balcony of his Toronto hotel room after he and his wife filed for divorce.

robert herjavec

Robert and Diane in January 2013.

“It’s been a terribly difficult year. We were great parents and a great team, but over time we drifted apart,” he said of his now ex-wife, Diane Plese.

Robert and Diane were married for nearly 25 years before announcing their separation earlier this month. After their split, the ‘Shark Tank’ star confessed his three children — daughters Caprice and Skye and son Brendan — sadly refused to speak to him.

robert herjavec 'dwts'

Robert with his ‘DWTS’ partner Kym in February 2015.

“Everyone has their kryptonite,” he said. “For me, it was my kids. It took me to a place I never thought I would go.”

Since the breakup, Robert — who is worth an estimated $125 million — has been rehearsing eight hours per day with his ‘DWTS’ pro partner, Kym Johnson.

“I went into this really petrified, but now I’m thinking, ‘I got this,'” he said of his new role on the show. “I’m just super excited because it’s a different experience, one that’s definitely out of my comfort zone.”