last week I asked a question about having issues running macros with SAP GUI scripts contained within on other people's PCs. I have gotten some updated information that I believe changes the question fundamentally so I will repost.
I made a macro series, one of which extracts data from the SAP system and imports it into Excel. While it runs smoothly on my computer, it begins going haywire the second it gets to a SAP GUI recorded script portion when used on anyone else's PC. At first I believed this may be an issue between servers but upon experimenting I have found the following.
I recorded this particular portion on three separate computers and 3 separate SAP GUI logins. This piece simply selects a specific field in order to input a particular number.
- My Computer
session.findById("wnd[0]").maximize session.findById("wnd[0]/usr/ctxtRIWO00-QMNUM").Text = Cells(i + 2, 5) session.findById("wnd[0]/usr/ctxtRIWO00-QMNUM").caretPosition = 9 session.findById("wnd[0]/tbar[1]/btn[25]").press
- Co-Worker 1
session.findById("wnd[0]").maximize session.findById("wnd[0]/usr/ctxt").Text = Cells(i + 2, 5) session.findById("wnd[0]/usr/ctxt").caretPosition = 9 session.findById("wnd[0]").sendVKey 0
- Co-Worker 2
session.findById("wnd[0]").maximize session.findById("wnd[0]/tbar[1]/btn[7]").press session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell/shellcont[1]/shell[1]").selectItem " 2","C 6" session.findById("wnd[0]/usr/cntlCONTAINER/shellcont/shell/shellcont[1]/shell[1]").ensureVisibleHorizontalItem " 2","C 6"
Now as you can see, the first 2 codes are similar but with slight differences. Neither of these codes will run on any other computer besides the one that they were recorded on.
The last code is very different but runs universally on every computer. We are not sure why this is but I need the same capability to be able to create shareable macros for my company.
Has anyone seen this issue before? Does anyone recognize why these codes might be so different? Maybe a hidden setting?
Thanks for your help guys.