ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Emailing (https://www.excelbanter.com/excel-programming/351984-excel-emailing.html)

Pat M

Excel Emailing
 
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


Tom Ogilvy

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





All times are GMT +1. The time now is 07:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com