Using ActiveWorkbook.EnvelopeVisible = True to send part of a sheet as an email.
I was using the below code in Excel 2003 and it worked with no problem. I am now using Excel 2010 and I get "Run-time error '287' Application defined or object defined error.
I have the following code:
Activeworkbook.Names.Add Name:="EmailBody", RefersToR1C1:="=Email!R38c13:r100c15"
Application.Goto Reference:="EmailBody"
ActiveWorkbook.EnvelopeVisible = True
With ActiveSheet.MailEnvelope
.Introduction = ""
.Item.sentonbehalfofname = my email address
.Item.To = email to send to
.Item.Subject = Range("o35").value
.Item.send
End With
It errors out when it gets to the .Item.send line.
Does anyone know what the issue could be? Thanks.
|