Skip to Content
0

Refresh Macro in BPC based on condition

Oct 19, 2016 at 02:54 PM

274

avatar image
Former Member

Dear BPC Friends,

I am working on BPC 10.1 NW. I am developing a input template which has two worksheets i.e 1) Report and 2) Input_Form.

Report has macro 'Refresh Tab' .This refresh tab work based on value of cell in K22 . When the value of this cell (k22) is "NO" then it will refresh the Report. But when the value of this cell (k22) is "YES" it just need to refresh Input_Form. I am using following code. This code is only working when the value of K22 is "NO".

Kindly advice how the macro should work when the value of K22 is "YES"

Option Explicit

Public Sub Refresh_Data()

Dim EPMObj As New FPMXLClient.EPMAddInAutomation

If Range("k22").Value = "No" Then

EPMObj.RefreshActiveWorkBook

End If

If Range("k22").Value = "yes" Then

EPMObj.refreshworkbook.("Input Schedule")

End If

End Sub

Thanks,

Rahul

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Vadim Kalinin Oct 21, 2016 at 08:17 PM
0

Just minimal corrections to JP code:

Public Sub Refresh_Data()

Dim EPMObj As New FPMXLClient.EPMAddInAutomation
If Range("A2").Value = "NO" Then
EPMObj.RefreshActiveWorkBook
Else If Range("A2").Value = "YES" Then
Worksheets("Input Schedule").Activate ' Input Schedule is the name of the sheet
EPMObj.RefreshActiveSheet
End If

End Sub

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 20, 2016 at 06:37 AM
0

Hi Rahul,

Sheet 2 is your input schedule sheet name.Try below code:

Option Explicit

Public Sub Button6_Click()

Dim EPMObj As New FPMXLClient.EPMAddInAutomation

If Range("A2").Value = "NO" Then

EPMObj.RefreshActiveSheet

End If

If Range("A2").Value = "YES" Then

Worksheets("Sheet2").Activate

EPMObj.RefreshActiveSheet

End If

End Sub

Regards,

JP

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 21, 2017 at 02:38 PM
0

Thanks Vadim

Share
10 |10000 characters needed characters left characters exceeded