【软件自动化测试-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

 

你可能感兴趣的:(Excel,测试,Path,Hyperlink)