cancel
Showing results for 
Search instead for 
Did you mean: 

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

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 ! 🙂

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member574707
Discoverer

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

Former Member
0 Kudos

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.



former_member186338
Active Contributor
0 Kudos

And where is the question????

Former Member
0 Kudos

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

former_member186338
Active Contributor
0 Kudos

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

You have to provide maximum details.

Former Member
0 Kudos

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.
former_member186338
Active Contributor
0 Kudos

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!