cancel
Showing results for 
Search instead for 
Did you mean: 

BW - VBA

Former Member
0 Kudos

Hallo Experts,

how can we realize to jump from one workbook to another workbook without queries?

And where can we find some documentation about BW and VBA????

Thank you very much

Santra

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Santra,

Can you explain more about what you mean by "jump from one workbook to another workbook without queries"?

I am sure that I can give you code to do this, if I know what it is you want to do.

- Pete

Former Member
0 Kudos

Hallo Peter,

thank you very much. We just want to use BW as an entry for management reports. For this goal we also have some Excel-Reports (no true BW-Reports; that means these reports has no query, they are just saved as an Workbook.

One of these Excel-Workbooks is the menu-Workbook. The manager should first use these workbook. That means the managers open in the first step these workbook.

They should have die chance to jump from these workbook in the other Excel-Workbooks. I tried these with the following code:

Private Sub CommandButton1_Click()

Dim wbID As String

ActiveCell.Activate

wbID = "3XGM809K40SEYJ6ZE2UOSHR85"

Run "SAPBEX.XLA!SAPBEXopenWorkbook", wbID

End Sub

But it does´t work:

The System told me, it can not find the macro:

Run "SAPBEX.XLA!SAPBEXopenWorkbook", wbID

So what can i do?

Santra

Former Member
0 Kudos

Hi Santra,

Now I understand. First, some general guidance. Then, a specific recommendation.

To see all of the functions and subroutines available to you, do the following:

1. open the VB Editor (Alt + F11)

2. be sure that the Project Explorer window is open (Ctrl+R)

3. click on the object SAPBEX (sapbex.xla)

4. open the Object Browser (F2)

5. in the selection box, select SAPBEX

6. under Classes, scroll to bottom and select xBEXapi

7. on the right, you will see all of the API functions listed

You will see that there is no function named SAPBEXopenWorkbook.

I believe that the function you want is SAPBEXreadWorkbook.

Try this:

Private Sub CommandButton1_Click()

Dim wbID As String

ActiveCell.Activate

wbID = "3XGM809K40SEYJ6ZE2UOSHR85"

retVal = Run("SAPBEX.XLA!SAPBEXreadWorkbook", wbID)

If retVal = "" Then

MsgBox "Unable to locate workbook on BW server."

End If

End Sub

- Pete

Former Member
0 Kudos

Hallo Pete,

thanks a lot. Sorry for the delayed answer. I just came back from holiday.

It works.

Santra

Former Member
0 Kudos

Hello Santra,

following link provides enough information on BW-VBA

hope it helps.