Forum Discussion
Sending Enter Key
- Apr 27, 2023
Here’s an example of how you could modify your code to send the Enter key to the external application:
VBA.Shell "Explorer.exe C:\Users\Documents\My Application", vbNormalNoFocus Application.Wait (Now + TimeValue("0:00:02")) ' Wait for 2 seconds Application.SendKeys "{ENTER}", TrueThis example, use the Application.Wait method to pause the macro for 2 seconds before sending the Enter key. This gives the external application time to open and become the active window.
Or
Application.SendKeys "{ENTER}"Please, keep in mind that the SendKeys command can sometimes be unpredictable and may not work as expected.
Alternatively, you can try using a different library file for the external application to avoid the pop-up message altogether. If that's not possible, you could consider using a different method to open the application, such as the Shell command, which may allow you to bypass the pop-up message.
I hope this helps!
Here’s an example of how you could modify your code to send the Enter key to the external application:
VBA.Shell "Explorer.exe C:\Users\Documents\My Application", vbNormalNoFocus
Application.Wait (Now + TimeValue("0:00:02")) ' Wait for 2 seconds
Application.SendKeys "{ENTER}", TrueThis example, use the Application.Wait method to pause the macro for 2 seconds before sending the Enter key. This gives the external application time to open and become the active window.
Or
Application.SendKeys "{ENTER}"Please, keep in mind that the SendKeys command can sometimes be unpredictable and may not work as expected.
Alternatively, you can try using a different library file for the external application to avoid the pop-up message altogether. If that's not possible, you could consider using a different method to open the application, such as the Shell command, which may allow you to bypass the pop-up message.
I hope this helps!