Micro Focus QTP (UFT) Forums
Aquire a localsheets number instead of its name? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Aquire a localsheets number instead of its name? (/Thread-Aquire-a-localsheets-number-instead-of-its-name)



Aquire a localsheets number instead of its name? - erickingston - 03-09-2010

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