Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
e-mail subject name changing
hello all. ive been using the code below for some time now to send e-mails
when an assigned button is clicked (thanks RDeB) but now i need to make a change. Part of my system adds worksheets to a final workbook, and this is the one that is sent. Is it possible to write in to the macro so the name of the workbook is changed to the name of the last copied worksheet? (save as?) Or so the subject line of the e-mail contains the name of the copied worksheet/s? Sub MailOrder() Dim wb As Workbook Set wb = ActiveWorkbook If Val(Application.Version) = 12 Then If wb.FileFormat = 51 And wb.HasVBProject = True Then MsgBox "There is VBA code in this xlsx file, there will be no VBA code in the file you send." & vbNewLine & _ "Save the file first as xlsm and then try the macro again.", vbInformation Exit Sub End If End If On Error Resume Next wb.SendMail ", _ "Test Order e-mail" On Error GoTo 0 End Sub Thanks in advance, Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
e mail same body different subject | Excel Discussion (Misc queries) | |||
Hyperlink mailto - ref cell for mail subject | Excel Worksheet Functions | |||
Variables in the subject line of an e-mail hyperlink | Excel Discussion (Misc queries) | |||
Create an e-mail with recipient, subject and text | Excel Programming | |||
Subject line in E-mail | Excel Programming |