my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{SheetsInNewWorkbook} = 1; my $Book = $Excel->Workbooks->Add; my $Sheet = $Book->Worksheets(1); $Sheet->{Name} = 'Candle'; # Insert column titles my $Range = $Sheet->Range("A1:E1"); $Range->{Value} = [qw(Time Open High Low Close)]; $Range->Font->{Bold} = 1; $Sheet->Columns("A:A")->{NumberFormat} = "h:mm"; # Open/High/Low/Close to be displayed in 32nds $Sheet->Columns("B:E")->{NumberFormat} = "# ?/32"; # Add 15 minute data to spreadsheet print "Add data\n"; $Range = $Sheet->Range(sprintf "A2:E%d", 2+$#Bars); $Range->{Value} = \@Bars; #### while ($inBuf = ) { chomp($inBuf); ++$line_count; $inBuf =~ s/^\"//; # Take out any LEADING or $inBuf =~ s/\"$//; # TRAILING double quotes # OK, Process this record @fields = split(/\,/,$inBuf); print "\nProcessing record $fields[0]"; push @rows, @fields; ++$item_count; } # End of csvFILE or we reached our Runaway count close csvFILE;