Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I get the selected cells in an Excel COM add-in?

Status
Not open for further replies.

siftach

Programmer
Jul 22, 2003
78
IL
I made a COM add-in for excel and I manage to get everything except for the collection of the selected cells. In VBA there is a collection called Selection and from what I understood the Excel.Application has a Selection collection as well, but I do not know how to access the members of this collection.

I am using VS 2005 and developing in .NET 2.0.
 
Several threads cover Excel. I would suggest looking at the MSDN article 306022 or 301982
djj
 
I did read those artivles, the problem is that the code there is not 100% correct. I actually managed to solve the problem by ignoring the warning MSDEV gave me with this code:

Dim oExcel As Excel.Application
Dim oCell As Excel.Range

For Each oCell In oExcel.Selection
AddPhone(oCell.Value.ToString)
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top