Problem with sendkeys function cant get it to wait correctly

Maui

Board Regular
Joined
Jan 13, 2006
Messages
159
I am trying to open a programme write a password and then fater it has logged in the programme says logged in. at this point I want to press the "OK" button in the pop up box.


I am using the code below. I can get the programme to enter the password, but then I cant get the OK on the pop up box. it is something to do wtih the wait function in sendkeys I think.


Can anyone help me.




Application.SendKeys "{tab}white {enter}", Wait = True,

Application.SendKeys " {enter}",
Application.Run ("Adaytum_cubeRefreshAll")
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try this code. Start with a 10 sec. delay, if this is OK, then shorten the delay second by second to make the code faster...

Application.SendKeys "{tab}white {enter}"
'- delay 10 seconds
Application.Wait Now + TimeValue("00:00:10")
Application.SendKeys " {enter}",
Application.Run ("Adaytum_cubeRefreshAll")
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top