Cesar PeRi
New Member
- Joined
- Jan 5, 2023
- Messages
- 1
- Office Version
- 365
- 2021
- Platform
- Windows
Hello friends of MrExcel.com good evening, I request your help please, I can't figure out how I should do so that the data such as user, password, date from-to are editable (variables) and not fixed
Set objshell = CreateObject("WScript.Shell")
Set objapp = objshell.Exec("C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe")
Application.Wait Now + TimeValue("00:00:05")
AppActivate "SAP Logon 770" '(el nombre que te aparezca en la pestaña cuando lo abras)
Application.Wait Now + TimeValue("00:00:04")
Application.SendKeys "~", True '(la virgula significa Enter)
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "pere***", True '(Usuario)
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "{TAB}", True
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "******", True '(Contraseña)
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:03")
Application.SendKeys "{F3}", True '(Regresa pantalla anterior)
Application.Wait Now + TimeValue("00:00:03")
Application.SendKeys "mb51", True '(Tx)
Application.Wait Now + TimeValue("00:00:03")
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.SendKeys "2608", True '(Planta)
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "101", True '(Movimiento)
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "03.01.2023", True '(Fecha inicio)
Application.SendKeys "{TAB}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "03.01.2023", True '(Fecha fin)
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{tab}", True
Application.SendKeys "{tab}", True
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
'Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "/CESAR REP", True '(Lay out)
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{F8}", True
Thanks for your help
Set objshell = CreateObject("WScript.Shell")
Set objapp = objshell.Exec("C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe")
Application.Wait Now + TimeValue("00:00:05")
AppActivate "SAP Logon 770" '(el nombre que te aparezca en la pestaña cuando lo abras)
Application.Wait Now + TimeValue("00:00:04")
Application.SendKeys "~", True '(la virgula significa Enter)
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "pere***", True '(Usuario)
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "{TAB}", True
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "******", True '(Contraseña)
Application.Wait Now + TimeValue("00:00:02")
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:03")
Application.SendKeys "{F3}", True '(Regresa pantalla anterior)
Application.Wait Now + TimeValue("00:00:03")
Application.SendKeys "mb51", True '(Tx)
Application.Wait Now + TimeValue("00:00:03")
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.SendKeys "2608", True '(Planta)
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "101", True '(Movimiento)
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "03.01.2023", True '(Fecha inicio)
Application.SendKeys "{TAB}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "03.01.2023", True '(Fecha fin)
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{tab}", True
Application.SendKeys "{tab}", True
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
'Application.SendKeys "{DOWN}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.SendKeys "{DEL}", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "/CESAR REP", True '(Lay out)
Application.SendKeys "~", True
Application.Wait Now + TimeValue("00:00:01")
Application.SendKeys "{F8}", True
Thanks for your help