cancel
Showing results for 
Search instead for 
Did you mean: 

While press save button in excel i want to ran a script file

former_member307359
Participant
0 Kudos

Hi expert,

I got an requirement, while pressing save button i want to ran a script file, In that script file i did all calculation.

Please help to resolve this issue.

Regards

Vimal Raj

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member307359
Participant
0 Kudos

Thank you so much for your valuable guidance.

Former Member
0 Kudos

Hi vimal,

simply call your script in degault logic.

*include script name

hope this will solve your problem

former_member307359
Participant
0 Kudos

without using default logic, how to solve this issue

Former Member
0 Kudos

Hi vimal,

If if you don't want to include your script in the default then use VBA code.


Assign script to DM package.

Dim EPM As New FPMXLClient.EPMAddInAutomation


Function After_save()

EPM.DataManagerRunPackage "package_name", "Data Management", ""

End Function

Hope this will solve your problem.

former_member186338
Active Contributor
0 Kudos

Hi Vimal,

Very strange idea: "without using default logic"!!!


- If you want to perform calculations after the new/changed data is saved to the cube - then default.lgf is the right solution (can be replaced with write back badi, but it's a complex job).


- If you want to perform calculations independent on data saved - then VBA plus DM package.


Vadim


P.S. Read here:


former_member307359
Participant
0 Kudos

In my default logic I have  many calculations of different templates which is hampering my performance, but the user requirement is not run DM package, but has to be performed during the save written in VBA

former_member186338
Active Contributor
0 Kudos

About performance:

Sorry, but it means that your default.lgf is written incorrectly - may be fixed scoping with XDIM_MEMBERSET is used in default.lgf etc...

"but the user requirement is not run DM package, but has to be performed during the save written in VBA" - even more strange, you don't want to use default.lgf and you don't want to use DM package?? What do you want??? Please explain the business case: step by step!

Vadim

P.S. If you want to calculate some values in Excel cells before sending data to cube you can simply use Excel formulas Or VBA code in Function BEFORE_SAVE - but it's not a perfect idea...

former_member307359
Participant
0 Kudos

Sorry, but it means that your default.lgf is written incorrectly - may be fixed scoping with XDIM_MEMBERSET is used in default.lgf etc...


Is there a way to scope based on which template , which logic needs to be run?

ex sales. xlsm template should only specific set of code in default.lgf in xdim_memberset.

I understand based on dimension , you can scope


but the user requirement is not run DM package, but has to be performed during the save written in VBA" - even more strange,


It will take 5 clicks to perform dm package, and one click for save button, plus you don't have enter input values for package if I restrict the dimension member processing in script through scoping.



former_member186338
Active Contributor
0 Kudos

"Is there a way to scope based on which template"

"It will take 5 clicks to perform dm package..."


Unfortunately you are going in the wrong direction! You have to understand how BPC works...


1. You can perform calculations for the new or changed data sent to cube. Example: in the account dimension you have accounts PRICE and QUANTITY. [PRICE]*[QUANTITY] result has to be written to account [AMOUNT]. Each send of PRICE, QUANTITY, PRICE and QUANTITY will result in calculation of AMOUNT.

But AMOUNT will be calculated only for specific month, specific entity etc - ONLY related to sent data!


2. DM package is launched with user selected scope! And calculations are performed for the selected scope! The scope can be selected by VBA code if required:


Vadim

damovand
Product and Topic Expert
Product and Topic Expert
0 Kudos

Raj,

If you want to save the data to BPC NW backend then you have to use BPC provided methods for doing so.  That is either default.lgf or DM package to run some logic.  When you say you want to save data with VBA it makes no sense because VBA is a tool for Microsoft products.  There is no way you can save data to BPC NW through a VBA, if that is indeed what you mean to do.  Also, invoking DM package through VB code will not require additional clicks on the users' part.  But the person who writes the VBA code needs to ensure that all parameters are passed correctly.

Regards,

Leila Lappin