Are you doing this in a VSTO project? If so,this line should work:
Globals.ThisWorkbook.Application.Selection.End(Excel.XlDirection.xlDown).Select()
If you aren't doing it inside a VSTO project, you might try explicitly referencing Excel.Application. For example,
Dim xl As Excel.Application
xl.Application.Selection.End(Excel.XlDirection.xlDown).Select()
Regards,
Steve
http://www.OfficeZealot.com/vsto |