BlueInk has asked for the wisdom of the Perl Monks concerning the following question:
I then pass it to the function. capconverter($excelfile ,$HPLC_to_UV_Factor ,$HPLC_Collum ,$UV_Collum ,$Data_row_start);if(/;;HPLCColumn;;([0-9]+);/){ if ($number == 2){ $HPLC_Collum= $1; $number ++; }else { die ; }
Which gives me the following errorsub capconverter { my($excelfile ,$HPLC_to_UV_Factor ,$HPLC_Collum ,$UV_Collum ,$Data +_row_start)=@_; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); my $Book = $Excel->Workbooks->Open($excelfile); $Excel->{DisplayAlerts}=0; my $WorkBooknumber = 6; my $Sheet = $Book->Worksheets($WorkBooknumber); # your work sheet numb +er my $rowholder = $Data_row_start; while ((defined ($Sheet->Cells($rowholder,1)->{'Value'}))){#&&( define +d ($Sheet->Cells($rowholder,$HPLC_Collum)->{'Value'}))){ $Sheet->Cells($rowholder, 19)->{'Value'}= ($Sheet->Cells($rowholder,$H +PLC_Collum)->{'Value'} *$HPLC_to_UV_Factor); #to UV Calculation $rowholder ++; } $Book->SaveAs($excelfile); $Book->Close; }
How ever if i switch the code from $Sheet->Cells($rowholder,$HPLC_Collum)->{'Value'} to ($Sheet->Cells($rowholder,18)->{'Value'} It works.Win32::OLE(0.1709) error 0x800a03ec in METHOD/PROPERTYGET "Cells" at C:\Documents and Settings\KHusban +d\Desktop\ New Folder\exceel.pl line 272
|
|---|