The office candy dish was sabotaging Melanie Meek's efforts to slim down. Then, she declared war.

Bowls filled with chocolates were swept off co-workers' desks and into drawers. Pastries, doughnuts and other snacks were stashed in a separate room. Her rule, she told co-workers in their Canton, Ohio, real-estate office: "If I have to smell it, I will move it."

How can something so sweet be so divisive?

Some people believe that setting out little bowls of chocolates and mints builds esprit de corps in the office. It creates an opportunity to chat with co-workers who drop by. Then there are the folks who haul in cookies, birthday cakes, leftover holiday desserts and goodies from their kids' school fund-raisers. Bosses, too, often keep the office candy dish stocked to pump up the staff.

“ Every time the FedEx driver shows up, I'm praying it will be fresh fruit. ” — Kim Jackson

And, in the end, each empty calorie rankles co-workers trying to eat healthy.

There is research to show how irresistible the candy dish can be. A four-week study of 40 secretaries found that when candy was visible in a clear, covered dish, participants ate 2.5 pieces of chocolate on top of the 3.1 candies they would have eaten had the chocolates been in an opaque container, according to the 2006 study in the International Journal of Obesity. Moving the dish closer, so the subjects could reach the candy while seated at their desks, added another 2.1 candies a day to their intake.

"The proximity and visibility of a food can consistently increase an adult's consumption," says the study, led by Brian Wansink, a professor of marketing and human behavior at Cornell University, Ithaca, N.Y., and author of "Mindless Eating." He adds, "Even for a person with the greatest resolve, every time they look at a candy dish they say, 'Do I want that Hershey's Kiss, or don't I?' At the 24th time, maybe I'm kind of hungry, and I just got this terrible email, and my boss is complaining—and gradually my resolve is worn down."

Kim Jackson goes out of her way not to look at the table laden with food right outside her office at the Salem, Ore., construction company where she works. Covered with cookies, brownies, cake, candy and other treats brought by clients or employees, the table is nicknamed "the buffet," says Ms. Jackson, an accounts-payable specialist. "Every time the FedEx driver shows up, I am praying it will be fresh fruit." She sometimes deflects co-workers' pressure to have a snack by telling them she has to weigh in the next day at Weight Watchers.

To burn off 480 calories after eating just two pieces of candy a day in a work week, a 160-pound person would have to run (at 8 mph) 29 minutes. Getty Images

Sweating It Off Eating just two pieces of candy each workday adds about 480 calories to the bottom line over a work week. To burn that off, a 160-pound person would have to: Walk (2 mph): 157 minutes

Ballroom dance: 132 minutes

Golf (carrying clubs): 88 minutes

Backpack: 56 minutes

Run (8 mph): 29 minutes

Some people find solutions. John Guarino never touches the buttery mac-and-cheese that his co-worker, Cynthia Jackson, brings to frequent employee pot-luck lunches at the Los Angeles medical center where they work. "I always ask him, 'Are you eating today, John?' He laughs and grabs a diet drink and that's it," Ms. Jackson says.

Mr. Guarino a financial management analyst, says he dropped 53 pounds a few years ago and intends to keep the weight off. If he is tempted by a rich snack, he tells himself, "that's going to cost me an extra half-hour of exercising" to work it off. The Jenny Craig plan he followed advised scheduling periodic nutritious snacks to avoid random grazing.

Mr. Guarino also has mounted a counter-attack, urging anyone who fills an office candy dish to also fill a second bowl with sugar-free candy and gum. And last year, he started a "biggest loser" pool at his office. For $5 a head, co-workers competed to see who could lose the biggest percentage of body weight; one took home a $400 pot. Since then, he says, fewer high-calorie treats have been showing up at the office.

Elizabeth Josefsberg, a meeting leader for Weight Watchers in New York, advises dieters to keep fruit, mints, chewing gum or healthy snacks stashed in a drawer in case they are "dying for a treat" during the workday.

Still, there's more to the candy than calories. "Food is always comforting. It helps with the camaraderie in the department," Cynthia Jackson says.

“ Food is always comforting. It helps with the camaraderie in the department. ” — Cynthia Jackson

At Putnam Properties, the Ohio real-estate firm where Ms. Meek works, co-owner Wick Hartung likes to stock candy bowls in the reception area for visitors and their children who "might want a pick-me-up," he says. And he has long regarded bringing doughnuts for staff meetings as "a way to say, 'We appreciate your all being here.' "

"We're a small office, and food is a way to sort of share some camaraderie together," he says. Besides, he enjoys packing in a few maple bars himself.

Motivated by Ms. Meek, however, who has lost 80 pounds since 2009 partly by refraining from office snacks, her 10 co-workers have started keeping snacks under wraps. Mr. Hartung is bringing in fruit to staff meetings.

Write to Sue Shellenbarger at sue.shellenbarger@wsj.com