[英]How to get the active excel range by using VSTO?
I want to get the selected or focused range in Excel. 我想在Excel中获得所选范围或重点范围。 better returns me a Range object.
更好地返回我一个Range对象。 I knew activeCell, but it only gives me one cell.
我知道activeCell,但是它只给我一个单元。 What I need are a range of cells.
我需要的是一系列单元格。 Hope you can get my question.
希望你能回答我的问题。 Thanks.
谢谢。
Credit to @Tim as he got here first and gave good start for the answer (give the man an up tick!). 感谢@Tim,因为他先来到这里,并为答案提供了良好的开端(给那个人一个勾号!)。
But just to add to it (in C#) . 但是只是添加到它(在C#中)。 .
。 .
。
The follow code will provide global scope (Get you the desired info anywhere in your Add-In application). 以下代码将提供全局范围(在外接程序中的任何位置为您提供所需的信息)。
Microsoft.Office.Interop.Excel.Range stuff =
Globals.ThisAddIn.Application.Selection as Excel.Range;
Notes: 笔记:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.