This macro refreshes data on a worksheet called "BPC Report" from an external data source. It unprotects the sheet, refreshes the data using an EPMAddInAutomation object, then reprotects the sheet. The macro also refreshes all other worksheets in the workbook and ensures screen updating is disabled for performance.
This macro refreshes data on a worksheet called "BPC Report" from an external data source. It unprotects the sheet, refreshes the data using an EPMAddInAutomation object, then reprotects the sheet. The macro also refreshes all other worksheets in the workbook and ensures screen updating is disabled for performance.
This macro refreshes data on a worksheet called "BPC Report" from an external data source. It unprotects the sheet, refreshes the data using an EPMAddInAutomation object, then reprotects the sheet. The macro also refreshes all other worksheets in the workbook and ensures screen updating is disabled for performance.
This macro refreshes data on a worksheet called "BPC Report" from an external data source. It unprotects the sheet, refreshes the data using an EPMAddInAutomation object, then reprotects the sheet. The macro also refreshes all other worksheets in the workbook and ensures screen updating is disabled for performance.
Dim ws As Worksheet Dim WsSelect As Worksheet Application.ScreenUpdating = False Application.EnableEvents = False Call SheetUnprotect For Each ws In ActiveWorkbook.Worksheets If ws.Name = "BPC Report" Then ws.Visible = xlSheetVisible ws.Select EPMObj.RefreshActiveSheet ws.Visible = xlSheetHidden End If Next ws ThisWorkbook.RefreshAll Call SheetProtect Application.ScreenUpdating = True Application.EnableEvents = True End Sub Sub RefreshActiveSheet() Dim EPMObj As New FPMXLClient.EPMAddInAutomation Call SheetUnprotect EPMObj.RefreshActiveSheet Call SheetProtect End Sub Sub Save_WorksheetData() Dim EPMObj As New FPMXLClient.EPMAddInAutomation EPM.SaveAndRefreshWorksheetData End Sub Sub SheetUnprotect() Dim api As Object Dim SheetName As Worksheet Set api = Application.COMAddIns("FPMXLClient.Connect").Object Set SheetName = ActiveWorkbook.ActiveSheet If api.GetSheetOption(SheetName, 301) Then api.SetSheetOption SheetName.Name, 301, False, "123" End If End Sub Sub SheetProtect() Dim api As Object Dim SheetName As Worksheet Set api = Application.COMAddIns("FPMXLClient.Connect").Object Set SheetName = ActiveWorkbook.ActiveSheet If Not api.GetSheetOption(SheetName, 301) Then api.SetSheetOption SheetName.Name, 301, True, "123" End If