I can't seem to get this to work. I want to manipulate data on an Excel sheet and I don't know the name of the sheet. If I rename the sheet to "Sheet1" it works fine but otherwise no.

This reports the name correctly:

VB Code:
  1. Print objExcel.ActiveSheet.Name

But then this code doesn't work:
VB Code:
  1. i = 1
  2. Do
  3.    GetCount = .Cells(i, 2)
  4.    i = i + 1
  5. Loop Until GetCount = ""

It says method "Cells" failed. As you can see, I'm trying to find out how many data points are in a column, if someone has an easier way...

The test data I have currently only has one sheet, what if I had more than one?