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 |
All times are GMT +1. The time now is 09:42 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com