Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 2.48 KB

how-to-hide-controls-on-worksheets-when-printing.md

File metadata and controls

43 lines (34 loc) · 2.48 KB
title description ms.date ms.topic dev_langs helpviewer_keywords author ms.author manager ms.subservice
Hide controls on worksheets when printing
Learn that you can hide the controls when printing a Microsoft Office Excel worksheet that contains Windows Forms controls.
02/02/2017
how-to
VB
CSharp
printing [Office development in Visual Studio], worksheets
controls [Office development in Visual Studio], hiding while printing
printing [Office development in Visual Studio], hiding controls
worksheets, hiding controls when printing
John-Hart
johnhart
mijacobs
office-development

Hide controls on worksheets when printing

When you print a Microsoft Office Excel document that contains Windows Forms controls, the controls are visible on the printed worksheet. You can hide the controls when printing a worksheet.

[!INCLUDEappliesto_xlalldoc]

Note

If you hide controls that display data, such as a xref:Microsoft.Office.Tools.Excel.Controls.TextBox, the data in the control will not be visible on the printed worksheet.

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 Personalize the Visual Studio IDE.

To hide controls when a worksheet is printed

  1. Create or open an Excel project in Visual Studio and verify that Sheet1 is visible in the designer. For information about creating projects, see How to: Create Office projects in Visual Studio.

  2. From the Common Controls tab of the Toolbox, drag a xref:Microsoft.Office.Tools.Excel.Controls.Button control to a cell on Sheet1.

  3. In the Properties window, set the xref:Microsoft.Office.Tools.Excel.Controls.Button.PrintObject%2A property to False.

Related content