SAP Logon: Sapgui Component' could not be instantiated

Facing issue ‘SAP Logon’ activity. It’s throwing error, “Sapgui Component’ could not be instantiated”.

Note: I have already checked the session name and sap application path.

Hello @jaydeepbhunia!

It seems that you have trouble getting an answer to your question in the first 24 hours.
Let us give you a few hints and helpful links.

First, make sure you browsed through our Forum FAQ Beginner’s Guide. It will teach you what should be included in your topic.

You can check out some of our resources directly, see below:

  1. Always search first. It is the best way to quickly find your answer. Check out the image icon for that.
    Clicking the options button will let you set more specific topic search filters, i.e. only the ones with a solution.

  2. Topic that contains most common solutions with example project files can be found here.

  3. Read our official documentation where you can find a lot of information and instructions about each of our products:

  4. Watch the videos on our official YouTube channel for more visual tutorials.

  5. Meet us and our users on our Community Slack and ask your question there.

Hopefully this will let you easily find the solution/information you need. Once you have it, we would be happy if you could share your findings here and mark it as a solution. This will help other users find it in the future.

Thank you for helping us build our UiPath Community!

Cheers from your friendly

hi @jaydeepbhunia

Based on your screenshot It looks like you are trying to run Windows Shortcut instead of SAP Logon file

The most common path is "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe"

Check once more your machine, you need a path to EXE file (see my example in bold above)

Best regards, Lev

hi @LevKushnir

Have already tried with “C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe”.
Still no luck.

Jay did you ever resolve your issue?

@jaydeepbhunia @LevKushnir @Shawn_Ngoh
I am also facing the same problem, one thing i observed so far is is this activity works fine in Unattended execution. But gives the error as reported while we are debugging code or manually login to the machine where activity is running.
Please suggest if there’s any solution or checks we can do?

Hi @asif.shikalgar

First, try to tweak SAP Logon activity parameters NumberOfRetries and Retry Interval.
Second, if this doesn’t work, please use Task Manager in elevated mode (Run As Administrator) and show us the information about Username, Elevated Mode and UAC Virtualization of all UiPath processes, including UiPath.Executor, and saplogon.exe, like in the screenshot below:

Best regards,

Do you use SSO (Single Sign On) to authenticate into SAP?

Hello @iulian.mircea

I have provide both the working and non working machine snapshots.
for your info, UiPath Studio and Robot version on both machine is same i.e. v2019.10.5.

SSO to Authenticate - No we do not use.

One more strange behavior is observed, this SAP Logon activity works fine in Unattended execution, but while debugging or attended execution it fails with error reported/displayed.

Please let me know if any further details required.

Kind Regards,
Asif Shikalgar

Thanks for the fast reply. Can you please try this?

  1. Close Studio;
  2. Make sure that all UiPath processes that run with your username are closed (stop from Task Manager if needed); Don’t close UiPath processes running as System or Local Service! Just the ones running with your username;
  3. Open Studio again without elevated privileges (“Elevated” column in Task Manager should show “No”);
  4. Run the workflow again and see if it works. If it still doesn’t work, please check Elevated mode of UiPath.Executor and saplogon.exe to make sure it’s OFF;

Please let me know how it went.

P.S. I suspect that the workflow runs fine Unattended because the robot process is not elevated in this scenario. Also, there are some limitations in using SAPGUI Scripting if saplogon.exe runs elevated.


Hello @iulian.mircea

We have elevated permissions for UiPath to upgrade the existing version of Studio and Robot on any VM within our enterprise network. So I am unable to launch Studio without elevated privileges.
That may also force SAP to launch with elevated privileges, because when we launch SAP manually(by clicking SAP icon) it opens without elevated privileges (“Elevated” column in Task Manager should show “No”).

Though on working machine there’s no issue with similar settings, which lead to a thought if there’s something else is causing this issue.

We can connect for further troubleshooting, if required.

Kind Regards,
Asif Shikalgar

@asif.shikalgar Can you please try to use the attached workflow below to start SAP non-elevated and tell me if it works?
StartSAP.xaml (10.0 KB)

Basically, the workflow starts saplogon.exe spawned from explorer.exe , which should run non-elevated.

The workflow arguments are:

out_sapWindow - newly opened SAP Session Window
in_sapshcutPath - path to sapshcut.exe tool, located in the same directory as saplogon.exe, usually “C:\Program Files (x86)\SAP\FrontEnd\SAPgui\sapshcut.exe”

in_sapConnection - SAP Connection Description (Eg. “SSO->QE1 - Business Logistics Test” )
in_sapSystemId - SAP Connection System ID

in_sapClient, in_sapLanguage:

Best regards,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.