use Win32::OLE; use Win32::OLE qw/in with/; use Win32::OLE::Const 'Microsoft Excel'; use strict; use warnings; # Die on errors in Excel $Win32::OLE::Warn = 3; # Creates Excel Object my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel -> {"Visible"} = 0; # Doesnt allow any popups within Excel $Excel -> {"DisplayAlerts"} = 0; # Change path to where your files are located # Opens main Excel file and Center file my $Book2 = $Excel->Workbooks->Open('C:\TEST\Gold Report.xls'); # copy $Book2->Worksheets(1)->Range("A2:G2")->Copy; # This paste it into a different worksheet or workbook # How would I use this logic to paste it into the # body of my outlook email? $Book2->Worksheets(6)->Range("A2:G2")->PasteSpecial; $mail = new Win32::OLE('Outlook.Application'); $mail->{'Visible'} = 1; $item = $mail->CreateItem(0); $item->{'Subject'} = "This is a test"; $item->{'To'} = "image13\@gmail.com"; # I need to be able to paste it here $item->{'Body'} = "Here is the meat of the message TEST"; $item->Send(); #$mail->Quit();