Send Range of Cells to Body Of Outlook 365 Without Crashing

ExcelVBAnovice

New Member
Joined
Jun 14, 2014
Messages
5
Firstly, I'm not a programmer, but I dabble with Excel coding & VBA. I coded an Excel workbook 10 years ago to Email cells into the body of Outlook & it's worked great through
Office 2013, 2016 & 2021 but with Outlook 365 when clicking the 'send this section' tab, Outlook crashes

Sub Email_Instruction2()

ActiveSheet.Range("$A$1:$L$23").Select
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = "Here it is"
.Item.to = "VBA@mail.com"
.Item.Cc = ""
.Item.Subject = "Returns"

End With

End Sub

The cells are text, VLOOKUP coding to bring in descriptors from a stock code & there is one small picture.
Is there anyone who can tell me how to fix this?

Thank you
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Should there be a
VBA Code:
.Send
in there somewhere?
 
Upvote 0
Are you signed in to a Microsoft Account in Excel/Outlook?
 
Last edited:
Upvote 0
Should there be a
VBA Code:
.Send
in there somewhere?
Thank you for your reply. It's a Prescripted Email with recipient addresses already populated, but sometimes my Email address needs to be added when an investigation is required. I think .SEND would send it before any modification could be made. I have attached a screenshot where the user would click the send this section tab and normally this works, but with 365 it crashes after a second or two. I just tested this test file on Office 2021 with my Email address & it sent & received OK. At home, 365 is not signed in, at work 365 is signed in & both crash & automatically reopen stating something went wrong. No report of a runtime error.
 

Attachments

  • Screenshot.jpg
    Screenshot.jpg
    147.3 KB · Views: 2
Upvote 0
Can you share the code attached to the "GO" button?
 
Upvote 0
This is working for me. After code runs I hit Alt+S.
VBA Code:
Sub mailSheet()
With ActiveSheet.MailEnvelope
.Introduction = "Please read this and send me your comments"
    With .Item
        .To = "someone@email.com"
        .CC = "someoneelse@email.com"
        .Subject "Here is the document"
    End With
End With
End Sub
 
Upvote 0
This is working for me. After code runs I hit Alt+S.
VBA Code:
Sub mailSheet()
With ActiveSheet.MailEnvelope
.Introduction = "Please read this and send me your comments"
    With .Item
        .To = "someone@email.com"
        .CC = "someoneelse@email.com"
        .Subject "Here is the document"
    End With
End With
End Sub
Tested this on Office 2021 & it errored at .Subject "Here is the document". I'll test it on 365 and if it works, I'll have to have two lots of code, if 365, run this, otherwise run my original code. I had to do this on a file for renaming files for 32 & 64 bit. I'll test it later today & get back to you. Thank you
 
Upvote 0
Tested this on Office 2021 & it errored at .Subject "Here is the document". I'll test it on 365 and if it works, I'll have to have two lots of code, if 365, run this, otherwise run my original code. I had to do this on a file for renaming files for 32 & 64 bit. I'll test it later today & get back to you. Thank you
It errors on Subject because I forgot the = sign. Sorry.
VBA Code:
.Subject = "Here is the document"
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top