Posted on 2009-01-06 10:30:10-08 by mullet
Cell values from returned different sheet
Has anyone seen where a cell is returned from a different worksheet besides the one that is being used? In my case, I'm extracting values from the same cells across 10 different Excel files. In one file and for only two particular cells, I get the values of the cells on another worksheet of the workbook instead the desired sheet. I get the right values for all the other cells I'm extracting and I get the right values for all the cells in the other 9 workbooks.

Code Snippet:
my $workbook = Spreadsheet::ParseExcel::Workbook->Parse($file); my $sheet = $workbook->{Worksheet}->[0]; #for $row and $col in list of wanted cells { my $cell = $sheet->{Cells}[$row][$col]; my $val = $cell->{Val}; # do stuff with $val }

In 9 files everything works as expected. In the 10th file, I get the values I expect for most of the cells. For two cells in the worksheet, I get the values from the same cell locations on a different worksheet of the same file. All 10 files are copies of a master file. All 10 files have the same 3 worksheets.

Any suggestions to fix? I've alread downloaded 0.42...
Direct Responses: 9706 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.