I am trying to automate a process in SAP GUI.
I recorded a series of procedures and pasted the code in a macro sheet. I make Excel read the VBA code with the following commands:
Dim SapGuiAuto As Object
Dim Application As Object
Dim Connection As Object
Dim Session As Object
Set SapGuiAuto = GetObject("SAPGUI")
Set Application = SapGuiAuto.GetScriptingEngine
Set Connection = Application.Children(0)
Set Session = Connection.Children(0)
For one of the parts SAP makes a lot of calculations which takes a few minutes and around the middle of it, Excel generates the message:
I have to click OK to continue, then it pops-up non-stop and I have to do it like 10-15 times, which removes the point of automation.
When doing it without a macro, SAP does not give me any error.
I tried turning it off with
Application.DisplayAlerts = False
It instead gives me:
I searched the net and the site, but there was barely any useful info maybe because my question is too specific.
Some additional info:
- My laptop is from work and I cannot install any additional software or updates to it without permission.
- I tried checking the Excel option for DDE, but it only gives me an error when I try to run the script.
My Excel version is 2013.
How can I achieve one of the three solutions I can think of:
- Disable the pop up for OLE
- Make it automatically click OK every time it appears
- Make Excel freeze and wait while SAP does its thing? (Don't know if that makes sense.) Tried with
Application.Wait
, but without success