Funny (VBA) features in SAP BEx

Recently I had to deal with good old VBA. The product I had to do a bugfix/ heavy testing for is completely written in C#, but automates Office. Mostly Excel, but also PowerPoint all running as a service.

I had the pleasure to implement an automatic logon with Excel for BEx. BEx, aka SAP Business Explorer has an Excel part that is called Analyzer. This is the actual Excel Addin from SAP. When I started it first a little more than two years before, there was no documentation at all. So I was very pleased that I didn’t need to get any nasty “remove-that-password-from-that-Excel-file” virus contaminated program to get rid of the security issues SAP took for hiding their programs. It is not protected at all.

bex-analyzer-code-unprotected

In the meanwhile, SAP added some official documentation how to Use VBA to connect to BW server with BEx.

I had to play around with the connection’s properties, I was simply not able to connect. That object be retrieved by an Excel macro call. The properties are visible when they are added to the watch, getting the list of functions is a lot more tricky. Anyway, as it didn’t work in code but on the user interface, I checked the code in the Analyzer Excel Addin. After a while of code reading – VBA code is not meant to be immediatly understandable code – I recognized that the addin maintains a global variable that holds that connection information. It will be returned, when the connection had been established once. So I had a look onto all the properties – and try to set the default values.

I was surprised when I’ve seen this:

bex-test-dialog

What happened? Yes, it looks like the good old VB6 standard dialogs. But that wasn’t my code.

bex-test-dialog-code

SNCWithNoSSO is a boolean property. Trying to set false, raises that message box.

This was surely intensively tested. 😀

So I thought, what will happen when I put True?

 

bex-test-dialog

Okay. 😀