Shatner, 74, had completed filming Tuesday at the Manhattan Beach studio when the problem occurred, series publicist Stacey Luchs said.
He was being checked out at a nearby hospital and was expected to return to work Wednesday, Luchs said.
The actor, who played Captain Kirk in the original "Star Trek" series, received an Emmy Award last month for his portrayal of attorney Denny Crane on the ABC series.
It was his second Emmy for playing the character, who was first introduced on ABC's "The Practice."
Before "Star Trek," Shatner also played the central character in a well-regarded "Twilight Zone" episode, "Nightmare at 20,000 Feet," in 1963, and appeared in dozens of live television productions and feature films, including "Judgment At Nuremburg."
A native of Montreal, he attended McGill University, where a building is named after him. He also breeds and shows American Saddlebreds and Quarter Horses.
Meanwhile, another popular television favorite will be appearing on "Boston Legal:" Michael J. Fox, who left his "Spin City" sitcom because of his fight against Parkinson's disease, will guest star on three episodes scheduled to air this season.
Fox will play a CEO battling stage-four lung cancer who hires Denny Crane (Shatner) and his associates to represent him in a lawsuit involving a promising anticancer drug, ABC announced Monday.
During one of his visits, Fox's character becomes involved with Denise Bauer (Julie Bowen), one of the firm's lawyers.
"We couldn't be more excited. His comedic and dramatic strengths make him a natural for this series," creator and executive producer David E. Kelley said in a statement.
The Emmy-winning actor started the Michael J. Fox Foundation for Parkinson's Research after revealing in 1998 that he was battling the disease, a degenerative neurological disorder that affects movement.
Fox, 44, left "Spin City" at the end of the 1999-2000 season.