use Win32::OLE; sub new { # fileName my $self = {}; bless $self, shift; $self->{excel} = Win32::OLE->new("Excel.Application") or croak "Can't start Excel: ", Win32::OLE->LastError, "\n"; return $self; } sub disconnect { my $self = shift; $self->{excel}->Quit if $self->{excel}; }