Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Using Win32::OLE and Excel - Tips and Tricks

by monarch (Priest)
on Jul 26, 2005 at 02:46 UTC ( #478057=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Win32::OLE;
    use Win32::OLE::Const 'Microsoft Office';
    use Win32::OLE::Const 'Microsoft PowerPoint';
    use strict;
    
  2. or download this
    $Win32::OLE::Warn = 3; # die on errors
    
  3. or download this
    my $filename = "c:\\temp\\testpower.ppt";
    
  4. or download this
    print( "Starting Powerpoint Object\n" );
    my $power = Win32::OLE->GetActiveObject('Powerpoint.Application') ||
        Win32::OLE->new('Powerpoint.Application', 'Quit');
    
  5. or download this
    print( "Creating a presentation\n" );
    my $ppt = $power->Presentations->Add();
    $ppt->SaveAs($filename);
    
  6. or download this
    print( "Creating a slide\n" );
    my $slide = $ppt->Slides->Add(1, ppLayoutBlank);
    $ppt->SaveAs($filename);
    
  7. or download this
    my $pname = 'C:\WINNT\Web\Wallpaper\Fall Memories.jpg';
    my $shape = $slide->Shapes->AddPicture( $pname, msoFalse, 
    ...
    $shape->ScaleHeight( 0.5, msoTrue, msoScaleFromTopLeft );
    $shape->ScaleWidth( 0.5, msoTrue, msoScaleFromTopLeft );
    $ppt->SaveAs($filename);
    
  8. or download this
    print( "Adding a 4 wide by 3 high table\n" );
    my $table = $slide->Shapes->AddTable( 3, 4, 1, 100 );
    ...
        }
    }
    $ppt->SaveAs($filename);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478057]
help
Chatterbox?
[Corion]: I think there's always some Dell coupon around, at least I got one the last two times I bought a machine from them
[1nickt]: I have been an apostate in the Apple orchard for almost 15 years. But Dells are still high quality it seems, unlike Macs these days.
[1nickt]: And you can still configure the system at will, on the "Small Business" site.

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2017-03-27 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (320 votes). Check out past polls.