Getting Excel Sheet Name in QTP

0
85
Spread the love
  • 2
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    2
    Shares

Getting Excel Sheet Name in QTP

Hi (Excel) Here is some code to get Sheet name of a Excell.
Sub MsgBoxAllMySheets()
Dim sht As Worksheet
For Each sht In Sheets
MsgBox sht.name
Next sht
End Sub

Getting Excel Sheet Name in QTP

Now if you need to customize the code….i.e–If you need a particular sheet..
simple just put the below code
sSheetName=”abc” ‘Sheet to be searched
Sub MsgBoxAllMySheets(sSheetName)
Dim sht As Worksheet
For Each sht In Sheets
MsgBox sht.name
if sht.name=”sSheetName” Then
msgbox “Success”
end if
Next sht
End Sub

Getting Excel Sheet Name in QTP

Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 2
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    2
    Shares

LEAVE A REPLY

Please enter your comment!
Please enter your name here