Peter Gichira denied the charge during a court appearance in the capital, Nairobi, and was freed on bail.
Police say he was arrested on Saturday for trying to jump from the sixth floor of the electoral commission's offices.
He was among eight candidates who failed to meet the criteria to contest the 8 August election in Kenya.
The poll is expected to be a tight race between President Uhuru Kenyatta, who is seeking a second term, and veteran opposition leader Raila Odinga, who is running for a fourth time.
The BBC's Wanyama wa Chebusiri in Nairobi says Mr Gichira is a little-known politician who only came to prominence after his alleged suicide attempt.
He was disqualified from the race because he failed to obtain 2,000 signatures from people not affiliated to any party in at least 24 of Kenya's 47 counties.
Two officers rescued and arrested Mr Gichira after he broke a window pane and attempted to jump out of Anniversary Towers in Nairobi, police said.
Mr Gichira was also charged with destroying property and creating a disturbance.
He pleaded not guilty to all the charges and was released on $2,000 (Â£1,5000) bail.
The election will take place nearly a decade after disputed election results fuelled violence that left more than 1,000 dead and 500,000 displaced.
However, elections in 2013 passed off relatively peacefully.
A Kenyan man has been charged with attempted suicide for allegedly trying to jump from a building after his bid to run for president was rejected.