# use Constants use constant EXCEL => 'Excel.Application'; use constant WORD => 'Word.Application'; my $excel = Win32::OLE->GetActiveObject(&WORD)