Udostępnij za pośrednictwem


How to: Delete NamedRange Controls at Design Time

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Document-level projects

Microsoft Office version

  • Excel 2007

  • Excel 2003

For more information, see Features Available by Application and Project Type.

You can delete most host controls in the same way you delete Windows Forms controls, by selecting the control and pressing the DELETE key. You cannot delete NamedRange controls with the DELETE key because there is no visual representation of the control on the worksheet, and the function of the DELETE key on selected cells is to delete the text within the cells. In Microsoft Office Excel, you must use the Excel Define Name dialog box to delete the NamedRange controls.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

To delete a NamedRange control

  1. Right-click a NamedRange control.

  2. Select Manage Named Ranges on the shortcut menu.

    The Define Name dialog box opens.

  3. Select the named range you want to delete, and click Delete.

  4. Click Close to close the dialog box.

See Also

Tasks

How to: Add NamedRange Controls to Worksheets

How to: Resize NamedRange Controls

Concepts

Host Items and Host Controls Overview

NamedRange Control

Programmatic Limitations of Host Items and Host Controls

Other Resources

Excel Host Controls