in reply to Re: Multiple Charts in Excel
in thread Multiple Charts in Excel

Could you please be more specific how to use those properties. I tried:
$Chart->{Name} = "$curr_graph"; $Chart->{ChartType} = xlXYColumn; $Chart->{Top}=10; $Chart->{Left}=0;
But it didn't work. THanks, Vitaliy

Replies are listed 'Best First'.
Re: Re: Re: Multiple Charts in Excel
by Grygonos (Chaplain) on Jun 23, 2003 at 17:54 UTC
    The object hierarchy that OLE uses is odd, but it makes sense once you understand it.

    Code has been tested and does work.
    #!/Perl/bin/perl use Win32::OLE #Make new object my $excel = Win32::OLE->new('Excel.Application') or die "$!"; #Open the file $excel->Workbooks->Open("c:\\test.xls") or die "$!"; #Get the chart collection..the Item method returns the nth #item in the worksheets collection $charts = $excel->Worksheets->Item(1)->ChartObjects(); #find out how many you have $chart_count = $charts->{Count}; #loop and chage their left and top properties #again the item property returns the nth item in the #charts list for(my $i=1; $i =< $chart_count; $i++) { $charts->Item($i)->{Left}=XXXX; $charts->Item($i)->{Top}=XXXX }