07-06-2013, 06:41 AM
I wrote following code for a task
task: There are two column A and B, these are parameterized with some values in data table. Using this values with calculator I want to calculate WOR and type output in excel's row(1,1) for first iteration and next value in cell(2,1) for second iteration. Please help
task: There are two column A and B, these are parameterized with some values in data table. Using this values with calculator I want to calculate WOR and type output in excel's row(1,1) for first iteration and next value in cell(2,1) for second iteration. Please help
Code:
Set oexcel = createobject("Excel.Application") 'to create excel
oexcel.Visible = true
oexcel.Workbooks.Add
If not Window("Calculator").Exist(1) Then
systemutil.Run ("C:\WINDOWS\system32\calc.exe")
End If
Window("Calculator").WinEdit("Edit").Type DataTable("A", dtGlobalSheet)
Window("Calculator").WinButton("/").Click
Window("Calculator").WinEdit("Edit").Type DataTable("B", dtGlobalSheet)
Window("Calculator").WinButton("=").Click
WOR = window("Calculator").WinEdit("Edit").GetROProperty("text")
Window("Calculator").WinButton("C").Click
oexcel.Workbooks.cells(1,1).value = WOR