Read variable from other workbook with php macro

    Read variable from other workbook with php macro

    Hi,

    We have a Global workbook with business variables to use in other workbooks. Now I'm trying to read this variables with a macro in other workbooks. I'm using the next command:

    workbooks("//Default/Public Files/Definitions/Globals.wss")->names->item('var_business')->value

    But I don't get a value back. What is the correct way to read a variable from an other workbook.
    When I use activeworkbook->names->item('var_name')->value I get a value back from the active workbook.

    Regards
    Albert
    Its a bit late - a xmas gift:
    You would need to define the workbook you want to refer with Resource Tag - Right click on workbook in file manager - Mark/Tags -> As Resource .
    Then right click on the workbook where you want this reference -> Properties -> Resources -> Add the reference to Workbook you just added as resource.

    Now you are all set to use these references.

    PhP example:
    application()->workbooks()->item('GlobalWorkbook')->worksheets()->item('Sheet1')->range("A1")->value;

    Cell Formula example:
    =['GlobalWorkbook']Sheet1!A1

    - Here assumed you have marked GlobalWorkbook as resource tag.

    In your current workbook's properties ->resources you have added GlobalWorkbook as resources.


    Hope it helps!


    Best regards,
    Noel.

    noelgaur wrote:



    PhP example:
    application()->workbooks()->item('GlobalWorkbook')->worksheets()->item('Sheet1')->range("A1")->value;

    .


    that's a great one, I thought about it and tried but failed (forgot the "->item" after "workbooks() :-))


    thanks !
    laloune

    Post hoc, non est propter hoc