The exception that is thrown when code tries to remove a host control or Windows Forms control that was added to a document at design time.
[System.Diagnostics.DebuggerNonUserCode] [System.Serializable] public sealed class CannotRemoveControlException : Microsoft.VisualStudio.Tools.Applications.Runtime.RuntimeException
If you add host controls and Windows Forms controls to documents that are part of document-level customizations at design time, you cannot delete these controls at run time. For more information, see Adding Controls to Office Documents at Run Time.
This exception can be thrown by the Visual Studio Tools for Office runtime if you call one of the following methods to delete a control that was added at design time:
Deletemethod of a host control or Windows Forms control on a Word document or Excel workbook.