Need to press enter or "OK" to move past pop-up message

vikas0903

New Member
Joined
Dec 17, 2013
Messages
20

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Just use the sendkeys command in combination with the ontime command, right before you get the popup. And cancel right after if no pop-up was shown.

Place sub somewhere in your module and the Ontime just before you'd possibly get the pop-up Like this:
StartTime = Now + TimeValue("00:00:02")
Application.OnTime StartTime, "OKexecute"
Code where you get the pop-up.
'Now if it continues cause no pop-up was shown, do this to cancel (the pressing of enter):
Application.OnTime StartTime, "RunOnTime", , False

Sub OKexecute()
Application.SendKeys ("{ENTER}")
End Sub
 
Upvote 0
I tried putting code but it did not press OK, :-(
Following is the code that I used:
For Each htmlInput In htmlColl
If htmlInput.innerText = "Apply" Then
htmlInput.Click
'IEapp.Document.all.gcPopUp.value = ""
Sleep (4000)
StartTime = Now + TimeValue("00:00:03")
'Application.OnTime StartTime, "OKexecute"

Application.OnTime StartTime, "RunOnTime", False

Can you please any other idea?
 
Upvote 0
Hi, My apologies.........your code worked like charm....I just had to increase time duration by 1 sec..
I spoke too soon..thanks a lot for your help..
I tried everything since afternoon but nothing seemed to work
thanks again
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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