How to focus or select a cell in Excel

后端 未结 3 2208
感动是毒
感动是毒 2021-01-17 10:58

How to focus a cell in Excel VSTO using C# or to select first cell using C# in VSTO?

3条回答
  •  遥遥无期
    2021-01-17 11:12

    Here is one way:

    Excel.Worksheet activeSheet = ThisAddIn.ExcelApplication.ActiveSheet;
    var range = activeSheet.get_Range("A1", "A1");
    range.Select();
    

    ThisAddIn is the name of my test project.

提交回复
热议问题