MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Email Macro Problem

Posted by jo on February 15, 2002 6:51 AM

I have a macro that sends a copy of the workbook to our secretary. We've put this code in
ActiveWorkbook.SendMail recipients:="Jane"
However, when we click on the button the email shows up w/out her name in the to box. We type it in and she gets it twice. (We can put someone elses name in and still she will get it too). What are we doing wrong?

This is the entire code
Sub SendSheet()

'Sends a copy of single Worsheet as email
Application.ScreenUpdating = False
ActiveWorkbook.Close SaveChanges:=False
ActiveWorkbook.SendMail Recipients:="wendyb"
Application.ScreenUpdating = True
End Sub

Posted by DK on February 15, 2002 8:51 AM

The line Application.Dialogs(xlDialogSendMail).Show is unnecessary. The line further down ActiveWorkbook.SendMail Recipients:="wendyb" is all you need to send the workbook.


Posted by Jack in the Uk on February 15, 2002 2:49 PM

BTW this is fine provide you have them in the address book, silly i know but many people i know memorise ULR's and emails due to virus attacks... [NT]