in reply to Re: Reading Variables in Excel Spreadsheet
in thread Reading Variables in Excel Spreadsheet

I used your Perl on the spreadsheet with the variables defined.

Cell B1 was defined as depth and had the value of 559
Cell B2 was defined as height snd had the value of 560
Cell B3 was defined as Width and had the value of 590?

I got quite a lot of output but this well be because I simply removed cells to leave just a few to consider.
In this output I found the following
depth =CALC!$B$1
height =CALC!$B$2
width =CALC!$B$3

This seems usable since it effective says that the three variaibles depth, height and width are in the 3 cells B1, B2 and B3.
I think I can use the cell references to 'read' the values but I wondered what the most effect way of doing this.
Some clues will be appreciated
  • Comment on Re^2: Reading Variables in Excel Spreadsheet

Replies are listed 'Best First'.
Re^3: Reading Variables in Excel Spreadsheet
by poj (Abbot) on Jan 15, 2018 at 16:13 UTC

    You can read the values using the name

    for my $nm (in $Book->Names){ my $rng = $ws->Range($nm); printf "%s %s\n", $nm->{'Name'},$rng->{'Value'}; }
    poj
      Many thanks but there is something not quite right.
      In the 2nd line there is $ws. What is this variable since it is not defined in the original Perl?

        $ws is the worksheet, do you have multiple worksheets ?

        poj