cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting SAP (connected via Citrix) Database to Excel

Hi all,

I have been trying to extract a database from SAP via Excel VBA using the following code:

Option Explicit

Public SapGuiAuto, WScript, msgcol

Public objGui As GuiApplication

Public objConn As GuiConnection

Public session As GuiSession

Sub SAPCustomerReport()

Set SapGuiAuto = GetObject("SAPGUI")

Set objGui = SapGuiAuto.GetScriptingEngine

Set objConn = objGui.Children(0)

Set session = objConn.Children(0)

'Insert your SAP Script here

MsgBox "The file is updated"

End Sub

The database extraction is not included yet, however, since that part will not be too difficult using SAP script recording. Unfortunately, this code above (which I got from a standard template found on Google and it worked for other people) returns the following error:Run-time error '-2147221020 (800401e4)':Automation errorInvalid syntax.If I debug the error, it highlights the first rule after starting the Sub.I think it has something to do with me running SAP through Citrix, but I do not know how to adapt the code correctly... Can somebody help me or share a link to a template that is connecting Excel VBA to SAP via Citrix? It would be much appreciated!

former_member751591
Participant

Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with Community Q&A , as it provides tips for preparing questions that draw responses from our members.

For example, you can:

- outline what steps you took to find answers (and why they weren't helpful)

- share screenshots of what you've seen/done

- make sure you've applied the appropriate tags

- use a more descriptive subject line.

The more details you provide, the more likely it is that members will be able to respond. Feel free to also take our Q&A tutorial Q&A tutorial

Should you wish, you can revise your question by selecting Actions, then Edit.

By adding a picture to your Profile you encourage readers to respond.

0 Kudos

Can anyone from SAP team help on this? I'm facing same problem trying to connect SAP ECC on Citrix to Excel.

What kind of data source should be used to connect Excel to SAP ECC on Cirix?

Accepted Solutions (0)

Answers (0)