All controls must be instantiated before you can exit design mode. This error has the following causes and solutions:
Code can only run after all controls are instantiated and properly connected. Make sure every file needed for the control is available before trying again.
For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).