Cool these examples got me going. Now in my form I'm writing to my excel file. Well when I keep running the program it keeps writing over the same line in the excel file.

In one of my VBA apps I use this to count the used rows. Then add one to start a new line of information. Is there a similar function for vb.net?

The.....mycount = wksht.UsedRange.Rows.Count.......I think is where vb.net doesn't understand it?


VB Code:
  1. VB code
  2.  
  3. Dim mycount As Long
  4. Dim CurRow As Long
  5.  
  6. mycount = wksht.UsedRange.Rows.Count
  7. CurRow = mycount + 1
  8.  
  9.                 MySht.Cells(CurRow, 1) = MyJobNumbernName
  10.                 MySht.Cells(CurRow, 2) = MyJobPM

Thanks for any help!!