Can't find the end of Excel data using vb.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This code works in VBA but not in vb.net

lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Ro

xlUp and xldirection.xlup won't compile and activesheet.xldirection.xlup doesn't run

What am I missing here?!?!?
 
TC said:
lrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row

xlUp and xldirection.xlup won't compile and activesheet.xldirection.xlup doesn't run!

What am I missing here?!?!?

Does this VB file contain an

Imports Excel

declaration at the top?

If you use ILDASM on the Excel Interop assembly generated by TlbImp, then
you should find that the fully-qualified name you want is Excel.xlDirection.xlUp.
By importing the Excel namespace, and referring to xlDirection.xlUp, I think it
should work.


Derek Harmon
 
Back
Top