While working with SharePoint 2010, I encountered the following error: No available sandboxed code execution server could be found.
Solution
Start the SharePoint 2010 User Code Host windows service
Steps
1. Run services.msc from the run window
2. Locate the service and click the Start button
Hope your problem is fixed!