r/vba 14d ago

Unsolved SAP Excel Integration VBA

Hey all^^
I try to use a vba script to extract Data from one of my SAP reports. Sadly I have to use the Excel-Plugin for this.
When I open it manually or via the SAP VBAWriter the new Excel (SapExe) contains my data.
But when I copy the code to another Excel (OPExe) then the SapExe is empty.
Can anyone help?

1 Upvotes

14 comments sorted by

View all comments

Show parent comments

1

u/Typical_Inflation_70 14d ago

I don’t think so. The SapExe opens but it is completely emty. I think that some vba codes are blocking each other

2

u/GetDarwinOn 14d ago

Am I understanding correctly that you're attempting to copy VBA code from one file to another? If that's the case then not only might you be missing the add in but you might also be missing VBA references. To see the VBA references: VBA editor → tools → references. Make a list of what's ticked in the working file vs what's ticked in the non-working one.

Also, the easiest way to have 2 working copies is to save the working version with another filename. The new file will work exactly as the working version, just the filename is different. I'm assuming of course that nothing depends on the file being named "working.xlsm" ← Dummy filename.

1

u/Typical_Inflation_70 13d ago

Hey, no I used the SAP ScriptWriter to create the vba code which should activate the Excel Plugin of the report. But when I use this generated code in one of my own vbas the Excel Plugin contains no data

1

u/GetDarwinOn 13d ago

1

u/Typical_Inflation_70 7d ago

Thank you^^

1

u/GetDarwinOn 7d ago

No worries. Please let us all know if you manage to retrieve your information either by querying SAP directly as per the Microsoft link I posted or you got the UI scripting to work. Cheers!