Mitch Milam and I were working on this problem together. I had removed a series of custom attributes from the Opportunity entity and we could no longer publish some of the workflows associated with the entity.We got the following message: An Error has occurred. (Very helpful message)
After lots of #$%^& words, we finally found that all of the workflows with the problem were updating the Opportunity entity.
Once we clicked the ‘Set Properties’ of the Update and then clicked on Save & Close of Update Opportunity Web Page Dialog, the problem went away.
We think that it may be a bug in CRM 4.0, but that is the workaround! It looks like the attribute is referenced in the workflow code, even if you don’t make any changes to the deleted attribute. Opening and re-saving the Update web dialog seems to clear out the reference to the newly missing attribute.
Steve (& Mitch)