Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Disable the Refresh and Save Data tab in excel ribbon pane

I am trying to disable the Refresh and Save Data tab in EPM excel ribbon pane since already created custom macro button for both button. Currently i am able to suppress both tab by below vba code. The problem now is that in the BEFORE_REFRESH event, when clicking at the standard  Refresh button in excel ribbon pane the system pop up "Process in progress. Please wait........"  and its tricky to press msgbox. Is there a way stoping the process of refreshing and prompt the msgbox . Appreciate input

Dim blnMySave As Boolean
Dim blnMyRef As Boolean


Sub REFRESH()
Dim ea As New EPMAddInAutomation
        Dim selectd As String
    blnMyRef = True
    ea.RefreshActiveWorkBook
    blnMyRef = False
End Sub

Sub SEND()
Dim ea As New EPMAddInAutomation
        Dim selectd As String
    blnMySave = True
    ea.SaveAndRefreshWorksheetData
    blnMySave = False
End Sub

Public Function BEFORE_SAVE() As Boolean

If blnMySave Then

    BEFORE_SAVE = True

Else
      
    MsgBox "Please use SAVE DATA button on the worksheet!"

    BEFORE_SAVE = False

End If

End Function

Public Function BEFORE_REFRESH() As Boolean

If blnMyRef Then

    BEFORE_REFRESH = True

Else
   
    MsgBox "Please use Refresh button on the worksheet!"

    BEFORE_REFRESH = False

End If

End Function

Former Member
replied

Please correct the Save function (refresh is also invoked in save!):

Public Sub MySave()

    blnMySave = True

    blnMyRef = True

    epm.SaveAndRefreshWorksheetData

    blnMySave = False

    blnMyRef = False

    MsgBox "Saved"

End Sub

In my system the code is working correctly:

After pressing Refresh on Ribbon with some delay I have:

After pressing Save on Ribbon I have:

Pressing buttons on the sheet correctly refresh or save.

Vadim

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question