QTP Forums

Full Version: Aquire a localsheets number instead of its name?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What's the best method to aquire the identifying number of the active sheet within a DataTable (instead of the sheet name)?

Currently, this is the only way I've been able to get it:
Code:
Function GetSheetNumber
  For i = 1 to DataTable.GetSheetCount
    If DataTable.GetSheet(i).Name = DataTable.LocalSheet.Name Then
      GetSheetNumber = i
      Exit Function
    End If
  Next
End Function

It just seems too crude! Any suggestions??

Thanks,
Eric
Reference URL's