How to: Programmatically Select Worksheets
The Select method selects the specified object, which moves the user's selection to the new object. Use the Activate method if you want to bring focus to the object without changing the user's selection.
Applies to: The information in this topic applies to document-level projects and VSTO add-in projects for Excel. For more information, see Features Available by Office Application and Project Type.
If you want to select an existing worksheet in a VSTO Add-in or if the worksheet was created at run time in a document-level customization, you must access it by using the Excel Sheets collection of the Excel workbook; otherwise, you can access the Microsoft.Office.Tools.Excel.Worksheet host item directly.
In a document-level customization, add the following code to Sheet1.vb or Sheet1.cs.
Call the Select method of
Access the worksheet by using the Excel Sheets collection.
Working with Worksheets
How to: Programmatically Print Worksheets
How to: Programmatically Delete Worksheets from Workbooks
How to: Programmatically Hide Worksheets
How to: Programmatically Protect Worksheets
Worksheet Host Item
Global Access to Objects in Office Projects
Programmatic Limitations of Host Items and Host Controls
Optional Parameters in Office Solutions
Host Items and Host Controls Overview