Skip to Content
avatar image
Former Member

VBA macro not working

Current system versions:

SAP_BW : 740

CPMBPC : 810

EPM add in : Version 10.0 SP 20 .NET 3.5

Issue:

Following macro is written:

Function BEFORE_REFRESH()

If Range("validation") > 1 Then

    MsgBox "Please reduce the selection", vbCritical

    BEFORE_REFRESH = False

Else

   

    BEFORE_REFRESH = True

End If

End Function

This is not running as it is supposed to i.e. not throwing the msgbox for the condition specified

"validation" is name assigned to a cell.

FPMXLClient and FPMXLClient_Olaputilities are activated in references.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 06, 2015 at 10:15 AM

    Hi Amit,

    You have to put this code in the separate module, not in the worksheet or ThisWorkbook module!

    Vadim

    P.S. And instead of If Range("validation") > 1 Then use

    If ThisWorkbook.Worksheets("YourWorksheetName").Range("validation") > 1 Then

    Add comment
    10|10000 characters needed characters exceeded