Delen via


Excel Designer

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.

When you create a Microsoft Office Excel project, a workbook opens in Visual Studio that acts as a designer. You can design the look of each worksheet while it is open in the designer using the normal Excel tools. Each worksheet has its own design view that looks like a normal worksheet; the design view of the workbook is a large component tray that fills the designer. The worksheet tabs appear at the bottom of the designer, and you can navigate from one to another as usual. There is also a code file associated with the workbook and each worksheet.

When you write code behind a worksheet or the workbook, your code is local to that object. However, you can access the other objects by using Globals in your code. For more information, see Global Access to Objects in Visual Studio Tools for Office Projects.

When you double-click a normal worksheet cell, the cell switches to edit mode. When you double-click a cell that contains a host control, the Code Editor opens and the default event handler is generated or opened if it already exists. For more information about host controls, see Host Items and Host Controls Overview.

Toolbars

For Excel 2003 document-level projects, Excel toolbars appear inside the designer and are fully functional. The default set and layout of toolbars depends on how you have it set for Excel.

Toolbar customization works in the following ways inside the Visual Studio environment:

  • You can add and remove toolbars by using the View menu or by right-clicking the toolbar in the designer.

  • You cannot dock Excel toolbars into the Visual Studio set of toolbars.

  • You cannot customize toolbar layout within a toolbar group.

  • You cannot move toolbar commands into the menus.

There are two views in the designer: Design view and Code view.

  • Design view
    Design view is the graphical view of the worksheet and application. Excel opens in the designer along with the document so that you can access menus and toolbars or Ribbon tabs, and design the document without having to go outside of the Visual Studio environment. For Excel 2003 document-level projects, the Excel menus are merged with the Visual Studio menus, but the toolbars are in the designer just above the worksheets. For more information, see Office Menus in the Visual Studio Environment.

    You can edit and modify a workbook by using the native functionality of Excel, for example, by using undo, writing Excel formulas, and using the Find feature. You can also use the Visual Studio tool windows and editors to customize the document or workbook.

  • Code view
    The code editor associated with the workbook is the same as the Code Editor you use to write code in a Windows Forms application. For more information, see Code and Text Editor.

See Also

Concepts

Office Documents in the Visual Studio Environment Overview