I've thought about this all morning. Today I am wearing a new (and long-sought for and finally found) black denim skirt, which I paired with a button-down black and tan striped blouse and a green jacket. I think the dealbreaker with denim is often the color.....if it's blue, then it's a no-go, but if it's the fabric of denim in any other color, there's not an issue. I love the cut of denim jackets, and have them in white, blue, yellow and a brick color. All of denim fabric but the colors allow me to wear them at my admittedly casual workplace. I also often wear my blue denim jacket (in dark wash, from Gap) over dresses or other non-denim skirts or pants. No one has an issue with this. I have an adorable denim-like pencil skirt from Talbot's that I think is pretty professional looking and I would wear to a conference or something where I'm representing my company.
Edited: A friend who used to teach at a middle school, said the teachers voted to not wear denim to try to look professional and earn respect from the kids. This turned into a mess because some teachers then started wearing super sloppy looks (think khaki cargo capri pants with flip flops or yoga pants) but justified it by saying "but it's not denim, so thus, professional." Part of the issue with denim is that some people wear deeply distressed denim, or pants with way too low a rise, or just way too embellished. Denim becomes the scapegoat for a wider issue regarding fit and appropriateness.