Skip to Content
Author's profile photo Leslaw Piwowarski

VB coding in BEx Analyzer – writing my first custom functions

A large variety of custom VB functions can be created and used in BEx analyzer. That method may be useful especially when somebody don’t know ABAP.  

As an example creating VB functions converting 0fiscper value into full date is described here.

First, we have to be sure that macros can be saved in the workbook we use. Standard MS workbook .xlsx can’t do that. On such occasions I save the workbook as The Excel 97 – Excel 2003 file format.

After doing this you have to save the workbook on the server again


Now we can add macros to the workbook. We can do this in VB editor (Alt-F11)  

If we want to store our macros locally (as in this example) we should add a new module

vb creating module.png

and write down the code for the macro

vb writting a code.png

If we have the code stored in .bas file it can be imported here (we can do this when we want to use the same code in many workbooks).

vb importing module.png

  After writing or importing the code the workbook should be saved on the server with the “Save workbook” button.


Now function we stored in workbook can be used like this:

vb function usage.png

Please find attached file containing the code that was used here (the extention of the file has been changed to .txt so that the file could be stored in SCN server).

Regards, Leszek

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.