Go to Tools > Protect Document...
And check out any protection that may be turned on. If not then it could be that the form is in design mode and not
run mode when you are trying to run the macro code.