index > Visual Studio Tools for Office > Selection.End(Excel.XlDirection.xlDown).select()

Selection.End(Excel.XlDirection.xlDown).select()

I am struggling to get my VB project to work correctly. The project was done with VB6. The code to select the last Cell (with data) is

Selection.End(xlDown).Select

Reutener

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
Steve Hansen
reply 2

You can use google to search for other answers

 

More Articles

• How to 'translate' a Dataset into a Table in MS Word
• working with sql server data in ms excel
• can I use the Office 2003 dictionary
• Excel Template And Sharepoint
• wordObject and Printer Tray selection
• Null values displayed as 0 in OWC Pivot Table
• Range name errors on Sheet1_.Designer.vb
• Migrating Existing Excel with Macros to VSTO
• How to figure out what my problem is...
• Word OCX Control
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Excel Smart document variable passing
• VSTO
• Problems installing Visual Studio 2005 T
• NamedRange Filter
• After installing VSTO2005 no Office Temp
• Office Word 2003 component in .Net 2005
• COM ADDIN Not working in client mechins
• Display office documents in my windows f
• Why is a hidden VSTO document grabbing i
• Excel Question
• Best way to do this?
• 2005Beta2 cant launch Office project
• display image in listobject
• Unable to access "Page Brak View&qu
• insert image

Hot Articles

• Can't install VS 2005 Tools for Office
• Image Measurement Unit (Very Urgent)
• Add a Slide Module to the VBE with VBA
• MDX query to filter the cube
• Developing Smart Tags with .NET 2.0
• VSTO,Actions pane?? navigation buttons.
• Re-routing of PIAs in Office 2007
• Selection.PasteExcelTable not working co
• VB + Excel + Array
• can i use office(trial) to bulid app dep
• Error:"The Assembly could not be fo
• Bug in VSTO HandsOnLab.Lab5
• Not getting Application Path of my word
• Display Toolbar on IE
• Need Help in Programming Excel in C#

Recommend Articles

• Using Refedit Control in VB or Vb .net
• Error opening an excel file with cached
• Where is SQL Server 2005 Developer Editi
• Getting Excel install folder
• Custom Selection
• VSTO on server
• Getting Number of Charts and Setting Tit
• VS 2003 enterprise developer and vs 2005
• Add VSTORuntime and PIA to the bootstrap
• Setting focus to a word document
• Exception thrown when adding an XML tag
• ListObject behavior in Excel
• <path> is not a valid office add-i
• Deployment prerequisites question
• How to get to (automatically) opened doc