Skip to Content
1

Attaching VBA macro to open workbook in Customize user interface for Analysis (AO) 2.6

Mar 28 at 10:21 AM

127

avatar image
Former Member

Here, I want to customize user interface in analysis for office 2.6 SP 2. I am adding a group named "Budgeting" , and sub element as "open workbook" with a macro attached in split button which will show list of workbooks and user can click to open.

I am referring to the below mentioned code and youtube video:

https://www.youtube.com/watch?v=X1jXGF8NiFs

Example :
Sub OpenWorkbookViaAPI()

Dim lresult As Long

lresult = Application.Run("SAPOpenWorkbook", "DEMO_5", "DS_1", "ZCOUNTRY_VAR_02", "AT", "0I_FPER", "001.2011 - 004.2011")

End Sub

----------

Please revert ASAP
Thanks in advance for your help ! :)

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Vadim Kalinin Mar 28 at 10:23 AM
0

And where is the question????

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

My bad !
The mentioned VBA code I am using is not working , kindly help me with the sample code .

0

Sorry, but the comment "my code is not working" is like "SAP is not working" :)

You have to provide maximum details.

0
Former Member

If you open the video link below which I referred :

https://www.youtube.com/watch?v=X1jXGF8NiFs

There is a customization for user interface and I am doing in the same way but I am not getting the same results due to macro issue .

Could you please refer the video and share the macro for this customization.
0

Sorry, but I don't want to spend my time looking on some video...

If you want an answer, please clearly explain what are you doing!

0
avatar image
Former Member Mar 28 at 12:30 PM
0

The steps that I am following to create a customize profile in AO 2.6:
1. Click on option customize user interface.

2. Click on New group option and provide a label name(BUDGETING) for that new group.

3. Click on New sub element and provide the option for element(SPLIT BUTTON), enter the name for label (OPEN DOCUMENTS) and attach the file name of macro

The below mentioned Macro I used.:
Sub OpenWorkbookViaAPI()

Dim lresult As Long

lresult = Application.Run("SAPOpenWorkbook", "INP_VSC_CPX_PLN", "DS_1")

End Sub

4. After saving it and restarting the excel, the new tab which I created by the name of Budgeting is empty. There should be the documents listed as per the macro.


PFA images
This is my standard ribbon.

This is the snapshot taken from Video where similarly I am entering the macro name.



This tab is what I am expecting in my scenario but it is empty.




insert-macro.png (96.4 kB)
custom-ribbon.png (108.4 kB)
1zibv.png (77.3 kB)
Share
10 |10000 characters needed characters left characters exceeded
Christopher Schwarz yesterday
0

Hello,

you need to add "(control as IRibbonControl)" behind your macro name.

Example:

Sub OpenWorkbookViaAPI(control as IRibbonControl)

Dim lresult As Long

lresult = Application.Run("SAPOpenWorkbook", "DEMO_5", "DS_1", "ZCOUNTRY_VAR_02", "AT", "0I_FPER", "001.2011 - 004.2011")

End Sub

Go to SAP Help Analysis-Plugin User-Guide chapter "How do you customize a tab in the Ribbon?"

Best regards

Christopher

Share
10 |10000 characters needed characters left characters exceeded