You can use the commands Hide and Show of the API method SAPExecuteCommand to hide and show Analysis UI components.
The changed visibility of UI components is valid for the active workbook in which the VBA macro is executed. If the Analysis tab is hidden in a workbook and the user switches to another workbook, the Analysis tab is visible again. When switching back to the first workbook, the Analysis tab is hidden again.
The following types and IDs are supported:
Use this ID to hide the Analysis tab in the ribbon.
Example: Application.Run("SAPExecuteCommand", "Hide", "Ribbon", "All")
Use this ID to show the Analysis tab in the ribbon.
Example: Application.Run("SAPExecuteCommand", "Show", "Ribbon", "Default")
Use this ID to hide the Analysis context menu.
Example: Application.Run("SAPExecuteCommand", "Hide", "ContextMenu", "All")
Use this ID to hide the single context menu entry Refresh.
Example: Application.Run("SAPExecuteCommand", "Hide", "ContextMenu", "Refresh_Single")
Use this ID to show the complete context menu.
Example: Application.Run("SAPExecuteCommand", "Show", "ContextMenu", "Default")