내 코드가 기존 Excel 파일에 데이터를 저장하지 못합니다. 나는 엑셀 시트에 webtable에서 데이터를 복사하는 지역 창에서 볼 수 있지만 내가 당신 때문에 생각웹 테이블 내용을 qtp의 Excel 파일로 저장할 수 없습니다.
path = "D:\Demo\TestData\Shopping_Cart.xls"
set xl= CreateObject("excel.application")
xl.workbooks.open(path)
set nsheet=xl.sheets.item(1)
Set BrwsrCheckOut= Browser("name:=Checkout","title:=Checkout - Internet Explorer").page("title:=Checkout","name:=.*")
Set DesPrdChcKOut = Description.Create
DesPrdChcKOut("html tag").value = "TABLE"
DesPrdChcKOut("column names").value = "Product Name;Model;Quantity;Price;Total"
For IteratorRow = 1 To 2
'BrwsrCheckOut.WebTable(DesPrdChcKOut).RowCount Step 1
For IteratorCol = 1 To 3
'BrwsrCheckOut.WebTable(DesPrdChcKOut).ColumnCount(1) Step 1
val = BrwsrCheckOut.WebTable(DesPrdChcKOut).GetCellData(IteratorRow, IteratorCol)
Next
Next
'xl.Activeworkbook.saveAs "D:\Demo\TestData\Shopping_Cart.xls"
xl.Activeworkbook.save
nsheet.SaveAs("D:\Demo\TestData\Shopping_Cart.xls")
xl.ActiveWorkbook.Close
Set xl = nothing
Set nsheet = nothing
엑셀 파일을 데이터 테이블로 가져 와서 사용 가능한'Datatable' 함수를 사용하여 UFT 내에서 업데이트 한 다음 다시 내보내는 것을 고려 했습니까? 어쨌든 개체를 만드는 것보다 훨씬 간단합니다 ... – Dave