Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I want to store result in exce sheet
#1
Solved: 11 Years, 4 Months ago
Hi all.......I am facing one problem.This is my script.


Code:
a=window("Flight Reservation").WinButton
("Insert Order").CheckProperty("enabled",false,1000)
If a=true then
window("Flight Reservation").WinEdit("Name:").Set "Ragini"
b=window("Flight Reservation").WinButton
("Insert Order").CheckProperty("enabled",true,1000)
msgbox "disable"
msgbox "enable"
End If


Now I want to store the result in excel sheet.please anyone help me...
Reply
#2
Solved: 11 Years, 4 Months ago
Which Result do you want to store???, enable or disable???, maybe you can send those results to an excel sheet, read the article QTP and Excel, to get output values to your script, maybe and then export Datatable with the instruction DataTable.ExportSheet,
Reply
#3
Solved: 11 Years, 4 Months ago
Hi yagarules..........Output values i can get from application ..........Here I want to store both results "diabled" and "enabled" from my script.......
Reply
#4
Solved: 11 Years, 4 Months ago
Hi,

You can use the following code to store the data in excel:

Code:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.DisplayAlerts = False
Set objWorkbook = objExcel.WorkBooks.Open("path of the file.xls")  'this is the name of the excel file
Set objDriverSheet = objWorkbook.Worksheets("Sheet1")  'this is the sheet name in the excel file

columncount = objDriverSheet.usedrange.columns.count
rowcount = objDriverSheet.usedrange.rows.count
i = rowcount

If rowcount = 1 Then
   objWorkbook.Sheets("Sheet1").Cells(i,1).Value = a
   objWorkbook.Sheets("Sheet1").Cells(i,2).Value = b
Else
   i = i+1
   objWorkbook.Sheets("Sheet1").Cells(i,1).Value = a
   objWorkbook.Sheets("Sheet1").Cells(i,2).Value = b
End If

objWorkbook.Save
objWorkbook.Close
objExcel.Quit
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VB Script to separate upper & small Letters from a string and store in excel pradeep537 1 2,214 08-05-2016, 12:26 AM
Last Post: Ankur
  export data from one sheet to another sheet in data table raaj123 1 2,353 05-21-2013, 02:21 PM
Last Post: Shahzaad
Question Doesn't store value into database using Innertext Langxii 1 2,896 07-05-2011, 07:48 PM
Last Post: rajpes
  using queries in functions (Store Procedures) samson 1 2,139 03-12-2010, 01:20 PM
Last Post: Saket
  Checkpoint result affecting the script result sheetal 1 2,182 11-17-2009, 10:55 AM
Last Post: v_selvam

Forum Jump:


Users browsing this thread: 1 Guest(s)