in reply to Excel and OLE

I think you'll need to use events. Look at the 'Events' heading in the Win32::OLE POD. Unfortunately, it seems Excel doesn't provide a default event interface, so we'll need to dig around to try to find it. I'll experiment as I have time. Until then, you can check out google or a PowerPoint by Dave Roth for in-depth use of Win32::OLE.
--
May the Source be with you.

You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re2: Excel and OLE
by Solo (Deacon) on Sep 18, 2002 at 21:23 UTC
    Easier than I thought. We need the AppEvents interface. You should be able to adapt this code to your needs:
    use warnings; use strict; use Win32::OLE qw(EVENTS); my $Excel = Win32::OLE->new('Excel.Application'); $Excel->{Visible} = 1; my $Workbook = $Excel->Workbooks->Add; sub Event { my ($Obj,$Event,@Args) = @_; print "Event triggered: '$Event'\n"; } Win32::OLE->WithEvents($Excel, \&Event, 'AppEvents'); while (1) { sleep(1); Win32::OLE->SpinMessageLoop; }
    --
    May the Source be with you.

    You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.