Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to Click on Excel Dialog
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hello,
I am opening an excel and changing a value. When I change the value I get a dialog box(based on validations)

Code
Code:
Set objWorksheet1 = objWorkbook.Worksheets(2)
objWorksheet1.Cells(3,2) = "Oak"
Window("BM_269.xlsm").Dialog("Microsoft Excel").WinButton("OK").Click

The dialog box has focus but QTP is unable to click on the OK button. It doesn’t know the dialog exists. After I click OK manually everything runs fine.

Any suggestions?

Thanks,
Raj


Attached Files Image(s)
   
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
the object in the repository is not unique enough to be identified, so you either need to add a unique property value like text to the object or use DP to identify it like this

Code:
Window("BM_269.xlsm").Dialog("Microsoft Excel").WinButton("text:=OK").Click

That should do it.
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thanks for the response. The button is unique, that is the only button in the entire script. I think there is something happening with the macros, that is preventing QTP to get control.
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
If the Object Repsitory can "find the object" correctly, then I agree there is another reason. Can't imagine a Macro interfering with QTP clicking a button, but anything is possible.
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Raj -
Check this Post it helps you.

Let us know the outcome.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
Thanks for the suggestion. That is a good approch.
That did not work for me. I will have to check with the developer to find out whats happening behind the scene.
Reply
#7
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi Raj,
there are two ways:

First use Descriptive Progarmming to select the Dialog.
Or go to object repository an delete the test object details with name "is owned window" and "is child window" for the dialog.

ralf
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how can i click a macro button in excel using vbscript arpan 1 3,763 10-03-2017, 06:27 AM
Last Post: supputuri
  Unable to click on the WebButton with specified Index srach84 2 4,311 03-31-2015, 04:36 AM
Last Post: srach84
  Unable to click on WebButton in WebTable srach84 1 3,107 02-09-2015, 09:07 PM
Last Post: arpan
  Unable to click on moving text in a website Akhila 4 4,026 07-18-2013, 02:38 PM
Last Post: tanyamrz
  unable to click webelement by holding shift key tanyamrz 1 3,517 09-14-2012, 05:21 AM
Last Post: kcn

Forum Jump:


Users browsing this thread: 1 Guest(s)