Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An Array referance has been returned, but I asked for steak!

Status
Not open for further replies.

Jiggerman

Programmer
Sep 5, 2002
62
GB
Hello Folks,

Could some one give me a little help, I'm using Win32::OLE and am trying to use the Range function to assign a set of Values from an Excel spreadsheet. When I try and use this line;

@line = $Sheet->Range("A$counter:R$counter") ->{Value} ;

the value assigned to the array is an Array reference eg ARRAY(0x248e810).

I'm sure I really wanted the values from the spreadsheet, or a Steak at least!

Cheers
 
try?

$line = $Sheet->Range("A$counter:R$counter") ->{Value} ;

print @$line;



haunter@battlestrata.com
 
Hmm, I'm afraid taht that didn't seem to work, I think that it was a step n the right direction, but it still seems to be referencing another array!

Here is a segment of my code
---Code----
if($startFlag == 1){
print "\$counterTemp = $counterTemp\n";
$counterTemp++;
$line = $Sheet->Range("A$counter:R$counter") ->{Value} ;
$summaryHash{$$line[0]} = $$line[1].&quot;<=>&quot;.$$line[2].&quot;<=>&quot;.$$line[3].&quot;<=>&quot;.$$line[4].&quot;<=>&quot;.$$line[5].&quot;<=>&quot;.$$line[6].&quot;<=>&quot;.$$line[7].&quot;<=>&quot;.$$line[8].&quot;<=>&quot;.$$line[9].&quot;<=>&quot;.$$line[10].&quot;<=>&quot;.$$line[11].&quot;<=>&quot;.$$line[12].&quot;<=>&quot;.$$line[13].&quot;<=>&quot;.$$line[14].&quot;<=>&quot;.$$line[15].&quot;<=>&quot;.$$line[16];
print &quot;$$line[0]\n&quot;;
$nxtCounter = $counter+1;
$tempFirstCellValue = $Sheet->Range(&quot;A$nxtCounter&quot;) -> {Value};
if($tempFirstCellValue eq &quot;&quot; || $tempFirstCellValue == undef){
$endFlag = 1;
}

----

Thanks for any help.

cheers
 
Ahhhhaa! Got it, For the moment it is working,

You have to use the first reference that you get, to access the second array and then use that reference to get the values out, Mr Larry Wall is a Gggggggggggeeeeeeeeeeeeeeeenniiuuss, a cinfusing one, but a genius none the less!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top