Skip to Content
avatar image
Former Member

How to use macros in BPC 10

Hi Experts ,

I am trying to use macros to refresh the workbook on  button click, but it is throwing error Run Time Error '1004' "Can not run the macro refresh.The macro may not be available in this workbook or all macros may be disable "

I am using this simple script in VB Module:

Sub Test_Refresh()

Application.Run "Refresh"

End Sub

and assigning this Test_Refresh Macro on button.Even I am not able to use any other macros of BPC 10.I have already enabled macros in Excel option but not able to resolve this issue .

Please suggest me some solution .

Regards,

Sonam Gupta

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    May 15, 2012 at 07:43 PM

    Sonam,

    Did you enable the reference libraries necessary to access the API?

    http://scn.sap.com/people/devon.abraham2/blog/2012/02/23/using-the-api-in-epm-100-nw-bpc

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2012 at 12:08 PM

    hi Experts,

    Can anyone give me simple code to run a DataManagerPackage through Macros.

    As previously I mentioned I am not able to pass the arguments in the DataManagerPackage method.

    Please suggest me some solution for it.

    Regards,

    Sonam Gupta

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member John Leggio

      Hey use the following code it will work

      Option Explicit

      Sub Refresh_Click()

      Dim send As New FPMXLClient.EPMAddInAutomatio

      send.RefreshActiveSheet´╗┐

      End Sub

      Enable, FPMXLC client through reference and Macro's From excel..

      Regards,Hari

  • May 23, 2012 at 04:01 PM

    Hi Sonam,

    You may also need to lower your Macro Security to "Enable all macros ..."

    Thanks,

    John

    Add comment
    10|10000 characters needed characters exceeded

  • May 23, 2012 at 11:05 PM

    Sonam,

    once the reference library is enabled, the following script should be able to refresh the active sheet.

    Sub Test_Refresh()

    Dim a As New EPMAddInAutomation

    a.RefreshActiveSheet

    Set a = nothing

    End sub

    Let us know if this works or not.

    Akos

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Experts,

      Now I am able to use the macros.

      but i am not able to pass the arguments in DataManagerRunPackage.

      I am using this code:

      Sub Macro_Run_Package_PYActual()

      Dim client As FPMXLClient.EPMAddInAutomation

      Set client = New EPMAddInAutomation

      client.DataManagerRunPackage "Data Allocation", "Financial Process", "Company", "/CPMB/ALLOCATION"

      Set client = Nothing

      End Sub

      But this code is throwing error

      " RunTime Error '-1073479167(c0040201)':

      Internal Server Error "

      Can you please suggest me what is the error in my code .

      This code is also mentioned in http://scn.sap.com/thread/2130613 thread.

      Regards,

      Sonam gupta