天天看點

【軟體自動化測試-QTP實戰技能 11】== QTP code for excel link

Dim objWorkbook

xl_path="../test.xls"

Set gObjExcel = CreateObject("Excel.Application")

gObjExcel.DispalyAlerts = 0

Set objWorkbook = gObjExcel.Workbooks.Open(xl_path)

'Here the excel link is being created in sheet-1 to refer sheet-2's B4 cell.

gObjExcel.Cells(1,1).Value= "=HYPERLINK(""[Book1.xls]Sheet2!B4"",""click here"")"

gObjExcel.Save

gObjExcel.Quit

Set gObjExcel = Nothing

繼續閱讀