on 03-30-2021 3:45 PM
Hi
Is it possible to refresh and EPM report without activating or selecting a sheet?? I've always been told it's not good practice to select or activate a sheet when writing VBA.
Example - Current method
Dim api As Object
api = Application.COMAddIns("FPMXLClient.Connect").Object
Sheet1.activiate
api.Refresh
Example - What I'd like to use
Dim api As Object
api = Application.COMAddIns("FPMXLClient.Connect").Object
Sheet1.api.Refresh
Sorry, but there is no API that will refresh some particular sheet without activating it.
"I've always been told it's not good practice to select or activate a sheet when writing VBA." - wrong idea!
You can always store current active sheet in some variable, then activate sheet to be refreshed, then activate sheet saved in variable.
Dim wshCurrent as Worksheet
Set wshCurrent = ThisWorkbook.ActiveSheet 'store current active sheet
ThisWorkbook.Worksheets("SheetWithReportName").Activate
api.RefreshActiveSheet
wshCurrent.Activate 'restore active sheet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok thanks
"I've always been told it's not good practice to select or activate a sheet when writing VBA." - wrong idea! - Why?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Activate sheet is equivalent of user switching to some particular tab. Nothing bad... Just temporary activation.
Unfortunately, SAP is not providing API to refresh not active sheet (like we are able to refresh entire workbook). But a lot of other useful functionality is missing in EPM VBA API!
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.