It sounds as if you may be trying to erase the hard drive which you are booted from, which is not possible. You would need to boot from another volume such as an installer disk and run Disk Utility from there.
Erasing the drive will remove everything on it, so you would need to install an operating system for the MacBook to start up in the future.
Be sure you run a Time Machine backup before you erase the disk unless you are prepariing it for sale.
Apple What to do before selling or giving away your Mac
Also See Thomas Reed's How to Prepare your Mac for sale
and this thread