Automate

 View Only
  • 1.  WS scripts: possible to include formula creation

    Posted 01-04-2022 06:37

    Hi community!

    Is it possible to include Excel formula creation to transaction based script running? I know that it's possible to edit read data using formulas automatically, (Transform rule), but would it be possible to have the script add formulas to other cells as it works?

    A simplified but thorough example:

    I need to edit data based on Product Hierarchy. I create a script with MM03 that extracts that value to Excel column D. I have a separate table that has possible PH values in one column and a description of the needed edits in other column.

    Now, I'd like to automatize work a bit. I'd like to have the needed action appear in column E automatically based on PH using Vlookup. So I'd create a formula to column E, something to the likes of =vlookup(Dn; table; action column number; false) and spread this to the needed column E rows.

    Each time I run the script I have different amounts of materials I'll need to work with, so I have to apply the formula separately. Currently I have two options for this:

    • Write this formula to the first row of E and then after running the script drag it down from there for as many rows as I need
    • Write this formula to e.g. the first 200 rows of E to have it there already.
    Neither is convenient for various reasons.

    What I'd like to have:

    • Whenever the script extracts PH value to cell Dn, it would also write formula =vlookup(Dn;table here,action column number; false) to cell En that is next to it.
      • This way I'd automatically have the needed formula added for the correct amount of rows.
      • This certainly wouldn't limit to using vlookup - inserting other functions like this would open many possibilities.
    It would be convenient if WS could add functions as it goes and does things. Often the extracted values need to be used in a function and this could help a lot.


    So my question is:
    Is it somehow possible to have Winshuttle write formulas to cells when running a script? I tried to achieve this but didn't find a way.



  • 2.  RE: WS scripts: possible to include formula creation

    Posted 01-05-2022 03:42
    Hi Henry, may be another option: why not have this sort of calculated inputs calculated by a VBA-script ?
    I like to keep my WSscrips as simple as possible for in case some error pops up and you have to start faultfinding. So, especially with MM uploads where a large number of parameters are involved, I use a number of VBAscripts to calculate all parameters  that can be derived from a basic set of parameters.

    best regards, jan

    ------------------------------
    jan ketele | Sr engineer release mgt
    Xeikon Manufacturing NV | +3234431875
    ------------------------------



  • 3.  RE: WS scripts: possible to include formula creation

    Posted 01-05-2022 06:04

    I agree with Jan Ketele.

    I would also use a bit of VBA for this.



    ------------------------------
    Jan van Asseldonk | Consultant
    CTAC | +31629078169
    ------------------------------



  • 4.  RE: WS scripts: possible to include formula creation

    Posted 01-05-2022 06:46
    Thank you for your comments. So VBA means using an Excel Macro for accomplishing this. I understand what you mean, though for me being able to include it to a script would be the simpler solution: No need to create an another tool, no need for the runner to run anything separately. To me it feels more elegant to have just one thing that does everything.

    Is it possible to give a suggestion to WS developers about adding this feature if it doesn't exist now?

    ------------------------------
    --
    ------------------------------