Hello!
I'm currently lost and looking for some help with my code. I have searched the net for a couple days without luck. Hopefully i missed something and this is still possible.
This works perfectly in Notepad if i change AppActivate. Even as it is, it finds the correct order window remotely connected trough citrix. Starts inserting the item number.. But "enter" wont work. I have tried with wss.SendKeys ("~") / wss.SendKeys chr(13). If i press enter on my keyboard, the Citrix application recognizes the key and shifts over to quantity. (any way to get VBA to produce a "local keypress" ? :P)
What i have made is an excel sheet with all gods i usually order. I select how many of each, copy to one truncated list with a macro. Where Column B2 and down are the item number and A2 and down (until no more items to be ordered at that time) are the item quantity number. The order program trough citrix switches between item number and quantity with a single enter stroke, and then enter to get to the next item number. The next step if i would get "enter" to work with the citrix program, would be to get this to loop trough the order list from my excel sheet.
Thank you in advance. If i get this to work, it will save me 20 minutes a day
I'm currently lost and looking for some help with my code. I have searched the net for a couple days without luck. Hopefully i missed something and this is still possible.
Code:
Sub pleasework()
Dim keys As String
Dim wss As Object
Set wss = CreateObject("WScript.Shell")
AppActivate "Order"
Application.Wait Now() + TimeValue("00:00:02")
wss.SendKeys ("2207062")
Application.Wait Now() + TimeValue("00:00:01")
'wss.SendKeys ("~")
'wss.SendKeys chr(13)
wss.SendKeys ("{ENTER}")
Application.Wait Now() + TimeValue("00:00:01")
wss.SendKeys ("1")
Application.Wait Now() + TimeValue("00:00:01")
'wss.SendKeys ("~")
'wss.SendKeys chr(13)
wss.SendKeys ("{ENTER}")
Set wss = Nothing
End Sub
This works perfectly in Notepad if i change AppActivate. Even as it is, it finds the correct order window remotely connected trough citrix. Starts inserting the item number.. But "enter" wont work. I have tried with wss.SendKeys ("~") / wss.SendKeys chr(13). If i press enter on my keyboard, the Citrix application recognizes the key and shifts over to quantity. (any way to get VBA to produce a "local keypress" ? :P)
What i have made is an excel sheet with all gods i usually order. I select how many of each, copy to one truncated list with a macro. Where Column B2 and down are the item number and A2 and down (until no more items to be ordered at that time) are the item quantity number. The order program trough citrix switches between item number and quantity with a single enter stroke, and then enter to get to the next item number. The next step if i would get "enter" to work with the citrix program, would be to get this to loop trough the order list from my excel sheet.
Thank you in advance. If i get this to work, it will save me 20 minutes a day