Hello I have a problem, Ihave recorded a script that I want to use in excel vba but somehow it does not recording saving. Is there any different way to write the code that would save me the reports ?
Sub WCARG60()
Dim SapGuiAuto, Application, Connection, Session
Dim path As String 'add a variable for the file path
If Not IsObject(Application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set Application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(Connection) Then
Set Connection = Application.Children(0)
End If
If Not IsObject(Session) Then
Set Session = Connection.Children(0)
End If
Session.findById("wnd[0]").Maximize
Session.findById("wnd[0]/tbar[0]/okcd").Text = "Z_L_RU_OPS_TRN_MRX"
Session.findById("wnd[0]").sendVKey 0
Session.findById("wnd[0]/usr/radP_RB_A").Select
Session.findById("wnd[0]/usr/radP_RB_WRK").Select
Session.findById("wnd[0]/usr/txtS_FRGGR-LOW").Text = "60"
Session.findById("wnd[0]/usr/ctxtS_FRGCO-LOW").Text = "00"
Session.findById("wnd[0]/usr/ctxtS_FRGCO-HIGH").Text = "zz"
Session.findById("wnd[0]/usr/radP_RB_WRK").SetFocus
Session.findById("wnd[0]/tbar[1]/btn[8]").press
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").setCurrentCell 7, "FRGCO"
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectedRows = "7"
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").contextMenu
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectContextMenuItem "&XXL"
Session.findById("wnd[1]/tbar[0]/btn[0]").press
Aftet the Press dialog box saves as is open but it does not save
End Sub
Sub WCARG60()
Dim SapGuiAuto, Application, Connection, Session
Dim path As String 'add a variable for the file path
If Not IsObject(Application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set Application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(Connection) Then
Set Connection = Application.Children(0)
End If
If Not IsObject(Session) Then
Set Session = Connection.Children(0)
End If
Session.findById("wnd[0]").Maximize
Session.findById("wnd[0]/tbar[0]/okcd").Text = "Z_L_RU_OPS_TRN_MRX"
Session.findById("wnd[0]").sendVKey 0
Session.findById("wnd[0]/usr/radP_RB_A").Select
Session.findById("wnd[0]/usr/radP_RB_WRK").Select
Session.findById("wnd[0]/usr/txtS_FRGGR-LOW").Text = "60"
Session.findById("wnd[0]/usr/ctxtS_FRGCO-LOW").Text = "00"
Session.findById("wnd[0]/usr/ctxtS_FRGCO-HIGH").Text = "zz"
Session.findById("wnd[0]/usr/radP_RB_WRK").SetFocus
Session.findById("wnd[0]/tbar[1]/btn[8]").press
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").setCurrentCell 7, "FRGCO"
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectedRows = "7"
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").contextMenu
Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").selectContextMenuItem "&XXL"
Session.findById("wnd[1]/tbar[0]/btn[0]").press
Aftet the Press dialog box saves as is open but it does not save
End Sub