TA的每日心情 | 无聊 2018-9-27 10:05 |
---|
签到天数: 36 天 连续签到: 1 天 [LV.5]测试团长
|
回复 1# tianchuncheng
在脚本中直接获取,然后自己写脚本写入Excel比如:
- Public Function QTP_Write_Excel(pathway,sheetname,x,y,content)
- Dim srcData,srcDoc,sp1,sp2,num,use,a1,a2,a3
- set srcData = CreateObject("Excel.Application")
- srcData.Visible = False
- set srcDoc = srcData.Workbooks.Open(pathway)
- srcDoc.Worksheets(sheetname).Activate
- srcDoc.Worksheets(sheetname).Cells(x,y).value = content
- wait(1)
- srcDoc.Save
- srcData.Workbooks.Close
- Set srcDoc = nothing
- Window("text:=Microsoft Excel").Close
- End Function
复制代码 |
|