Read variable from other workbook with php macro

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Read variable from other workbook with php macro


    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.

  • 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:

    Cell Formula example:

    - 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,