Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default "Sendmail" macro to multilpe addresses

I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default "Sendmail" macro to multilpe addresses

What does the email address look like in A1. Did you seperate the E-Mail
addresses with a semicolon and a space? the email address should look like
the e-mail address in Outlook.

"Stephen C" wrote:

I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default "Sendmail" macro to multilpe addresses

Separate addresses in A1 by, say commas,
insert this line

addressees = Split(Range("A1"), ",")

before With wb line

and use

..SendMail addressees, "This is the Subject line"

Regards,
Stefi


€˛Stephen C€¯ ezt Ć*rta:

I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default "Sendmail" macro to multilpe addresses

You need to include Recipents and subject in the line. Excel was probably
putting your 2nd email address into the subject.

.SendMail Recipients:=(Range("a1")), _
Subject:="This is the Subject line"

"Stephen C" wrote:

Cell A1 contains ", this works fine.

I have tried adding the second one with a semicolon and space like this
; " but it will not work.

I am using Outlook Express NOT Outlook.

"Joel" wrote:

What does the email address look like in A1. Did you seperate the E-Mail
addresses with a semicolon and a space? the email address should look like
the e-mail address in Outlook.

"Stephen C" wrote:

I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default "Sendmail" macro to multilpe addresses

Thank you Stefi.

"Stefi" wrote:

Separate addresses in A1 by, say commas,
insert this line

addressees = Split(Range("A1"), ",")

before With wb line

and use

.SendMail addressees, "This is the Subject line"

Regards,
Stefi


€˛Stephen C€¯ ezt Ć*rta:

I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 51
Default "Sendmail" macro to multilpe addresses

This still does not work for Outlook Express.

Stefi's answer works fine.

"Joel" wrote:

You need to include Recipents and subject in the line. Excel was probably
putting your 2nd email address into the subject.

.SendMail Recipients:=(Range("a1")), _
Subject:="This is the Subject line"

"Stephen C" wrote:

Cell A1 contains ", this works fine.

I have tried adding the second one with a semicolon and space like this
; " but it will not work.

I am using Outlook Express NOT Outlook.

"Joel" wrote:

What does the email address look like in A1. Did you seperate the E-Mail
addresses with a semicolon and a space? the email address should look like
the e-mail address in Outlook.

"Stephen C" wrote:

I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default "Sendmail" macro to multilpe addresses

See this page for more info
http://www.rondebruin.nl/mail/folder1/mail5.htm

Read the info on the Tip page
http://www.rondebruin.nl/mail/tips1.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Stephen C" wrote in message ...
I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default "Sendmail" macro to multilpe addresses

You are welcome! Thanks for the feedback!
Stefi

€˛Stephen C€¯ ezt Ć*rta:

Thank you Stefi.

"Stefi" wrote:

Separate addresses in A1 by, say commas,
insert this line

addressees = Split(Range("A1"), ",")

before With wb line

and use

.SendMail addressees, "This is the Subject line"

Regards,
Stefi


€˛Stephen C€¯ ezt Ć*rta:

I have found some code on Ron de Bruin's web site which enables me to send
the active sheet as an attachment to an email address contained in cell A1.

This works fine but I now require it to be sent to more than one person, if
add a second email address to cell A1 the macro will not work.

Could someone please advise me how to change the following code to enable me
to send to multiple recipients contained in one cell.

Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
.SendMail (Range("a1")), _
"This is the Subject line"
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub

I am using excel 2000 & Outlook Express.

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
"Send Email" macro to multiple addresses LKP Excel Programming 16 November 3rd 08 09:08 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Read ".dll" files, the Macro "work flow" and the actual values of the variables when Macro is running [email protected] Excel Programming 5 May 16th 07 08:18 PM
Excel Macro to email to addresses in "Contacts" Tab Appelq Excel Programming 7 August 14th 06 05:51 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM


All times are GMT +1. The time now is 08:41 AM.

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"