IGNORE IT!! Just rise above it. Unless of course you sit in the corridor right next door to the Vending Machine - then you are probably in big trouble.
If you are tempted - talk yourself through what you've got to do to get to that piece of chocolate.
Get up from your desk, walk out of the office, walk to wherever the machine in (mine is in the next building!!) queue (possibly), choose what you want, get money from your pocket, make sure you have the correct change... hope for the best...
I always get really self-conscious at vending machines. I always imagine people walking behind me and thinking - she really doesn't need a chocolate - fat cow!!
So, that's what I do - I play mind games with myself!! lol
Hope this helps!!
Lx