Qtp Script to find the number of occurences of a char in a string-VB Script to find the number of occurences of a char in a string-QTP Scripts for beginners-VB Script


Qtp Script to find the number of occurences of a char in a string
 

str="hellllllllo all"

counter=0

For i=1 to len(str)

char=mid(str,i,1)

If char="l" Then

counter=counter+1

End If

Next

Msgbox counter

qtp script to display string vertically-vb script to display string vertically-QTP Scripts-VB Scripts and QTP-QTP Examples-QTP


qtp script to display string vertically
 

a = "Lakshmi"

x=len(a)

For i = 1 to x

b = b & vbnewline & Mid(a,i,1)

Next

Msgbox b

Qtp Script to add an image to excel sheet-Qtp Script to insert an image into excel worksheet


Qtp Script to insert an image into excel worksheet



Set Excel = CreateObject("Excel.Application")

 Excel.Visible = True

 Set workbook = Excel.WorkBooks.Open("C:\abc.xls") 

Set worksheet = workbook.Worksheets(1)

 Excel.ActiveCell.Worksheet.Pictures.Insert("C:\image1.JPG")

QTP Script to delete all the worksheets except for the first worksheet-VB Script to delete all the worksheets except for the first worksheet

QTP Script to delete all the worksheets except for the first worksheet



 Set Excel = CreateObject("Excel.Application")

 Excel.Visible = True

 Set Workbook = Excel.Workbooks.Open("C:\qtp.xls")

 i = Workbook.Worksheets.Count

 Do Until i = 1

 Workbook.Worksheets(i).Delete

 i = i - 1

 Loop

QTP Script to get name of all worksheets of an excel sheet-VB Script to get name of all worksheets of an excel sheet

QTP Script to get name of all worksheets of an excel sheet



 Set objExcel = CreateObject("Excel.Application")

 objExcel.Visible = True

 Set objWorkbook = objExcel.Workbooks.Open("C:\qtp.xls")

 For Each objWorksheet in objWorkbook.Worksheets

 Msgbox objWorksheet.Name

 Next

Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge