you'd be better off searching the mskb or msdn for this - perl merely autoloads all the OLE functions it finds available - it doesn't have them remembered anywhere.

you may find its something like ...->exec('Max(B3:O3)') or call or something odd like that..

remember that perl is case sensitive!

or you could just write a max function in perl - whereby you'd be able to tell _which cell_ had the max value, along with what it is..

btw: "$dirpath"."\\test.ppt" == "$dirpath\\test.ppt"
also my $r1 = $wsheet->Range("B3)->{Value}; <--- missing " after B3..

On Wed, 07 Jan 2004 14:37:46 -0600, Lance Hoffmeyer <[EMAIL PROTECTED]> wrote:

Anyone have any idea how I can find the maximum value in a range (B3:O3)?
The only way I can think of would be to write a formula in another cell and
compare this value to each of the values in B3:O3.  There has to be a better
way but darn if I can think of it.

Something like:
my $r1 = $wsheet->Max(B3:O3);  ##I know this doesn't work







use strict;
use warnings;
use Win32::OLE;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft PowerPoint';
use Win32::OLE::Const 'Microsoft Excel';
use Win32::OLE::Const 'Microsoft Office';
use Win32::OLE::Variant;

my $dirpath   = "c:\\test"; # Path to Excel and PPT
my $pptsheet  = 4;                                #to put sheet number here 4-30-2003

my $ppt=Win32::OLE->GetActiveObject('Powerpoint.Application')||
        Win32::OLE->new('PowerPoint.Application','Quit');
$ppt->{Visible} = 1;
my $p2 = $ppt->Presentations->Open({FileName=>"$dirpath"."\\test.ppt"});

foreach my $z (in $p2->Slides(1)->Shapes()){
if ($z->{Type}== 7){
my $zz=$z->OLEFormat->Object;
my $wsheet = $zz->Worksheets("Sheet1");

my $r1 = $wsheet->Range("B3)->{Value};
print $r1;
}
}


_______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs




_______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to