Thread: Excel Emailing
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel Emailing

appActivate Application.Caption

--
Regards,
Tom Ogilvy


"Pat M" <Pat wrote in message
...
I have the following code in an excel spreadsheet to send email. The

sending
of the email works fine but it does not make excel the active window after
sending. Is there a way to make excel active again so I can run other code
without having to manually activate excel.

Thanks
Pat
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = "
.Subject = "Machine Hours - Labor"
.Body = ""
.Attachments.Add

("\\epfilesrv\as400downloads\machine-labor\machine
hours - labor.xls")
End With

Set OutMail = Nothing
Set OutApp = Nothing