on 05-15-2012 7:17 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Akos,
I have tried to run following scripts :
Script1:
Sub DataMgr()
Application.Run "EPMExecuteAPI", "DataManagerRunPackage", "", "Time Data Allocation based on PY Actual", "Financial Process", "Company", "/CPMB/ALLOCATION"
End Sub
Script is not running,not getting any error message
Script2:
Sub DataMgr()
Application.Run "EPMExecuteAPI", "DataManagerRunPackage", "", "Time Data Allocation based on PY Actual", "Financial Process", ""
End Sub
Script is not running,not getting any error message
Script3:
Sub Macro_Run_Package_PYActual()
Dim client As FPMXLClient.EPMAddInAutomation
Set client = New EPMAddInAutomation
client.DataManagerRunPackage "Time Data Allocation based on PY Actual", "Financial Process", "Company", "/CPMB/ALLOCATION"
Set client = Nothing
End Sub
As mentioned in below thread
http://scn.sap.com/thread/2130613
Error Message:
" RunTime Error '-1073479167(c0040201)':
Internal Server Error "
Screen Shots:
Reference Library Selection:
DataManager Folder:
Regards,
Sonam Gupta
Sonam,
All of your settings seem to be correct. Script 2 should be the same as selecting a package and running it. I assume it runs fine from the 'Data manager' tab. At this point, the only advice that I have left is make sure you have the latest version of EPM. If that's the case, I would open a ticket. Sorry that I couldn't help.
Akos
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi Sonam,
You may also need to lower your Macro Security to "Enable all macros ..."
Thanks,
John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.