Cindy Meister
MKhare wrote: |
I'm surprised that there is no straightforward call in VSTO for this. I am trying to get the range of cells that have been selected by the user, i.e. after user has selected a region of cells using the mouse. This is the closest I came:
Globals.Sheet2.Application.ActiveCell
This only gives me the range object corresponding to the first cell on the top left of selection. Thanks in advance...
Maneesh
| |
How about Globals.ThisApplication.Selection
According to the Excel Help, this should return what you're looking for
"Returns the selected object in the active window, for an Application object, and a specified window, for a Windows object."
And a quick test shows it works: Application.Selection.Address returns (for example) $D$8E$9