bobsargent2002
New Member
- Joined
- May 23, 2018
- Messages
- 4
Hello,
I use the following code to automatically email a spreadsheet when a button is clicked on the sheet. The issue is that I cannot figure out how to have a popup window show up stating "Thank you. Your status update has been submitted.". Can anyone help?
Thanks in advance,
Bob
I use the following code to automatically email a spreadsheet when a button is clicked on the sheet. The issue is that I cannot figure out how to have a popup window show up stating "Thank you. Your status update has been submitted.". Can anyone help?
Code:
Private Sub CommandButton3_Click()
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Workbook
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveWorkbook
Doc.Save
With EmailItem
.Subject = "Status Update Form"
.Body = "Attached is an update for our store."
.To = "Enter Email Address Here"
.Importance = olImportanceNormal
.Attachments.Add Doc.FullName
.Send
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
Thanks in advance,
Bob
Last edited by a moderator: