VB操作EXCEL写入
' SSOService Web service object steps
login = WebService("SSOService").login(XMLWarehouse("SI_Login"))
login= replace (login,"<?xml version="+Chr(34)+"1.0"+Chr(34)+" encoding="+Chr(34)+"UTF-8"+Chr(34)+"?>","")
msgbox(login)
ResFileName=DataTable("ResFileName",dtGlobalSheet)
ResSheetName=DataTable("ResSheetName",dtGlobalSheet)
set xlsobj=createobject("excel.application") '创建excel对象
set xlsbook=xlsobj.Workbooks.Open("D:\liu-backup\QTPtest\TestRes\neimeng"+ResFileName+".xlsx") '打开指定的excel文件
Set xlssheet=xlsbook.Sheets("Res1") '设置操作sheet对象,可使用index-从1开始
xlssheet.cells(1,1)="login发送报文" '对第一列的第一行赋值
xlssheet.cells(1,2)="login返回报文"
xlssheet.cells(2,1)=XMLWarehouse("SI_Login")
xlssheet.cells(2,2)=login
xlsbook.Save '保存excel文件
xlsbook.Close '关闭
'authen = WebService("SSOService").authen("string (Autogenerated)")
'getAccount = WebService("SSOService").getAccount("string (Autogenerated)")
'pulse = WebService("SSOService").pulse("string (Autogenerated)")
'msgbox login