Showing results for 
Search instead for 
Did you mean: 

<VBA>To judge "Cancel" at variable selection screen in BEx analyzer

Former Member
0 Kudos

Hi BI experts,

I need some advices about how to judge whether "Cancel" button is pressed or not.

We need correction of Excel Macro for migrating reports from 3.x to 7.x.

<Summary of Macro>

1.Call variable selection screen once you pressed VBAbutton.

2.Then, depends on pressed "OK" or "Cancel", the following process wil be diverged.


&#65308;1st process's change&#65310;

Old&#65306;&#12300;Return_Code = Run("SAPBEX.XLA!SAPBEXrefresh", False, inWorksheet.Range("B30"))&#12288;&#12301;

New&#65306;&#12300;Return_Code = Run("BExAnalyzer.xla!MenuChangeVariable")&#12301;

<2nd process's change>

Under 3.x verstion, I used the situation that workbook would not be updated if you pressed "Cancel" button and write the logic.

But under 7.x verstion, even if you pressed the "Cancel" button, the workbook would be updated.

So, now I can not use the logic before and need to correct it.

Please give me some advice how to judge whether "Cancel" button is pressed or not at variable selection screen.

Also my correction of calling logic of variable selection screen?

Thanks a lot in advance!


Message was edited by:

Keiko Matsui

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I would like to add questions.

What I want to know is....

How to make variable selection button (VBA) in 7.x, which has chance to choose "OK" and "Cancel".

I see a lot of posts about VBA, but most of them are about under 3.x verstion.