Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
e mail same body different subject Marilyn Excel Discussion (Misc queries) 3 May 11th 08 12:31 AM
Hyperlink mailto - ref cell for mail subject LDUNN1 Excel Worksheet Functions 2 October 25th 06 02:01 PM
Variables in the subject line of an e-mail hyperlink midol559 Excel Discussion (Misc queries) 0 September 8th 06 04:30 PM
Create an e-mail with recipient, subject and text Martin[_21_] Excel Programming 2 November 7th 05 12:18 PM
Subject line in E-mail Ola Sigurdh Excel Programming 2 January 22nd 04 06:49 PM


All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"