Start of Content Area

Object documentation Tab Page: Exits  Locate the document in its SAP Library structure

Use

On the Exits tab page, you can choose whether a macro can be called during the refresh. You can choose any macro name. The macro is called once for each analysis table. If the workbook does not contain any analysis tables, the macro is not called.

Note that the macro is only called when the workbook is opened if the Refresh Workbook on Open flag is set on the General tab page.

The signature of the macro must be as follows: Sub <MACRO_NAME>(ParamArray varname())

<MACRO_NAME> is a place holder for the name of the macro, which can be any text of your choice,  for example, RefreshMacro.

The name of the data provider is in varname(0).

The range is contained in varname(1).

Example Example:

Sub RefreshMacro(ParamArray varname())

Dim lData_Provider As String

 

lData_Provider = varname(0)

Set lRange = varname(1)

 

MsgBox lData_Provider

End Sub

Insert Macro into Workbook

To use the BEx Analyzer API, you need a particular macro as well as references to the type libraries. Instead of manually maintaining the macro and references, you can do this using the Add Macros toggle button, which is on every tab page in the Workbook Settingsdialog box.

Note that this creates a hard reference to the type library, meaning that problems might occur if working in a different (if the Analyzer is installed in a different program directory, or in none at all). Before publishing a workbook, we therefore recommend that you remove the reference and convert all previously types objected (like BExApplication) to the standard VBA object.

Add Macros/Delete Macros

Under Extras  Macro Security Trusted Publishers, you can set the Trust Access to Visual Basic Project flag. This causes the text on the shift key to change from N Macro Access to Add Macros.

Choose Add Macros to attach the macro and references you need to use the BEx Analyzer API. To remove the references, choose Delete Macros. 

Note

If you attach macros to your workbook and then save them locally, a security popup will appear next time you open them. Macros are therefore not automatically attached to workbooks. To stop using macros and prevent these popups from appearing, choose the appearance choose Delete Macros.

 

 

 

 

End of Content Area