Press enter when alert pops up in excel
- Igor88
- Thread is marked as Resolved.
-
-
-
Re: Press enter when alert pops up in excel
Quote from AliGW;794025MODERATOR NOTICE: This topic has also been posted on other sites and may already have an answer elsewhere. Please take this into consideration when answering this question
*
Very funny:)
But i need a macro because I am not near computer when it pops up..it is hapenning in the night...so any suggestion?
-
Re: Press enter when alert pops up in excel
Not a joke - perhaps you had better read the rules to which you agreed upon joining this and other forums?
Thank you for the links.
-
Re: Press enter when alert pops up in excel
Ali, Igor88's opening post was a copy of his post on Stackoverflow and it does include a link to that thread.
-
Re: Press enter when alert pops up in excel
Quote from KjBox;794106Ali, Igor88's opening post was a copy of his post on Stackoverflow and it does include a link to that thread.
It didn't when I first posted - it does now, and you will notice that I have thanked him for the links and deleted my post.
-
Re: Press enter when alert pops up in excel
Sorry, missed that!
The reason Application.DisplayAlerts does not work is because there is no default button on that message box. The only way round the problem is to cross over to the dark side and use SendKeys.
Search for SendKeys in the VB Editor help box and get an idea how to use SendKeys.
-
Re: Press enter when alert pops up in excel
Quote from KjBox;794115Sorry, missed that!
The reason Application.DisplayAlerts does not work is because there is no default button on that message box. The only way round the problem is to cross over to the dark side and use SendKeys.
Search for SendKeys in the VB Editor help box and get an idea how to use SendKeys.
I tried this and this didn't work
Please HELP
-
-
Re: Press enter when alert pops up in excel
Quote from Carim;794145Thanks. but excel not recognize that i want to send "enter" to this popup
my code is :
Private Sub Workbook_Open()
On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.LockServerFile
SendKeys "{ENTER}", False
End SubWhen it goes to ActiveWorkbook.LockServerFile - the pop up comes out (before SendKeys "{ENTER}", False )....
-
-
Re: Press enter when alert pops up in excel
Yes. Tested it and still now working because the row that activates this pop up is :
ActiveWorkbook.LockServerFile
not before
any idea?
-
-
Re: Press enter when alert pops up in excel
Quote from Carim;794157This is the same code , ~ to enter.
The problem is in the row before : ActiveWorkbook.Lockserverfile - is stops the code and get a pop up out so the code not geeting to your row
-
Re: Press enter when alert pops up in excel
Quote from Igor88;794165This is the same code , ~ to enter.
The problem is in the row before : ActiveWorkbook.Lockserverfile - is stops the code and get a pop up out so the code not geeting to your row
As indicated in a previous post, the SendKeys instruction line needs to be located just before the line ActiveWorkbook.LockserverFile ...
-
Re: Press enter when alert pops up in excel
Quote from Carim;794167As indicated in a previous post, the SendKeys instruction line needs to be located just before the line ActiveWorkbook.LockserverFile ...
Thank you! it worked
Very strange , if i run the code row after row (F8) it is now working but if I run end to end without debugging it works
-
Re: Press enter when alert pops up in excel
Glad you could fix your problem ..:wink:
Thanks ...for your thanks ...:smile:
-
Re: Press enter when alert pops up in excel
Also, posted on Expert's Exchange!
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!