mharrington
New Member
- Joined
- Oct 7, 2020
- Messages
- 4
- Office Version
- 365
- 2016
- Platform
- Windows
- Web
Hey there - I work for a company that utilizes both Microsoft 2016 and O365 programs. Many users only have access to Outlook 365 and not the 2016 version.
What I'm trying to do, is create a button in excel that will automatically attach the workbook to an email. I have the following set up for Outlook 2016 users and it works great. But I'm struggling on how to duplicate this so that it composes the email in outlook 365. Any suggestions?
What I'm trying to do, is create a button in excel that will automatically attach the workbook to an email. I have the following set up for Outlook 2016 users and it works great. But I'm struggling on how to duplicate this so that it composes the email in outlook 365. Any suggestions?
VBA Code:
Sub SendWorkBook()
'Update 20131209
Dim OutlookApp As Object
Dim OutlookMail As Object
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
With OutlookMail
.To = Range("AA23")
.CC = ""
.BCC = ""
.Subject = "Report Name Here"
.Body = "Hello, please see the attached report."
.Attachments.Add Application.ActiveWorkbook.FullName
.display
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
End Sub
Last edited by a moderator: