Email code

O

ozhunter

I have the following VBA code that works, but I would like to avoid having to
click the OE message box that asks if you want to send the email when you run
the code. I was also wondering if you can specify text for the body of the
email, not something that changes all the time, it will be the same text each
time.

Sheets("Pay Slip").Visible = True
Sheets("Pay Slip").Select
Sheets("Pay Slip").Copy
Range("A1:G17").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("a1").Select
ActiveWorkbook.SendMail Recipients:="(e-mail address removed)", Subject:="Pay
Slip for Adam Brown - Claim No 16420EML"
ActiveWorkbook.Close SaveChanges:=False
Sheets("Pay Slip").Select
Sheets("Pay Slip").Visible = False


End Sub

Any help would be appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top