现在的位置: 首页 > 综合 > 正文

【软件自动化测试-QTP实战技能 19】== 关闭 MESSAGE BOX 当关闭EXCEL 时

2013年10月26日 ⁄ 综合 ⁄ 共 303字 ⁄ 字号 评论关闭

 

'Click on the excel application message box with QTP While closing the excel application

Set obj=CreateObject("Excel.Application")

obj.Visible=True

obj.DisplayAlerts=False

Set oWorkbook=obj.Workbooks.Open("H:/Book1.xls")

obj.EnableEvents =
False'Disable Events before closing workbook

oWorkbook.Close

obj.EnableEvents =
True

obj.Quit

抱歉!评论已关闭.