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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Bruno

Active Member
Joined
Feb 17, 2002
Messages
491
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")
 

Forum statistics

Threads
1,141,284
Messages
5,705,502
Members
421,399
Latest member
hjweiss00

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
Top