Hi All,
How to insert an IF function into SAP VBA Code so that IF a pop up comes up "Data has been changed:", "Do you want to save the changes?" Yes, No or Cancel and I want to Press Yes and enter to continue but I can't seem to figure this out.
This is my code after it's done the excel portion and connects to SAP
session.StartTransaction "DE9"
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "ZVP1A"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/tabsTABSTR/tabpVOR").Select
session.findById("wnd[0]/tbar[1]/btn[31]").press
session.findById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\folder\setup\"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").Text = "Preallocation.txt"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 17
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[0]/tbar[0]/btn[11]").press
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTABSTR/tabpBAS").Select
session.findById("wnd[0]/tbar[1]/btn[31]").press
session.findById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\folder\setup\"
TIA.
How to insert an IF function into SAP VBA Code so that IF a pop up comes up "Data has been changed:", "Do you want to save the changes?" Yes, No or Cancel and I want to Press Yes and enter to continue but I can't seem to figure this out.
This is my code after it's done the excel portion and connects to SAP
session.StartTransaction "DE9"
session.findById("wnd[0]").maximize
session.findById("wnd[0]/tbar[0]/okcd").Text = "ZVP1A"
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/usr/tabsTABSTR/tabpVOR").Select
session.findById("wnd[0]/tbar[1]/btn[31]").press
session.findById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\folder\setup\"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").Text = "Preallocation.txt"
session.findById("wnd[1]/usr/ctxtDY_FILENAME").caretPosition = 17
session.findById("wnd[1]/tbar[0]/btn[0]").press
session.findById("wnd[0]/tbar[0]/btn[11]").press
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/usr/tabsTABSTR/tabpBAS").Select
session.findById("wnd[0]/tbar[1]/btn[31]").press
session.findById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\folder\setup\"
TIA.