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
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
No comments:
Post a Comment