Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
LKP LKP is offline
external usenet poster
 
Posts: 19
Default "Send Email" macro to multiple addresses

I am trying to get a send email button to send emails to multiple addresses.
I can get it to work for one address, but I don't know how to do multiples.
Here's the code:

wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr
Set wb2 = Workbooks.Open(TempFilePath & TempFileName & FileExtStr)

With wb2
On Error Resume Next
.SendMail ", _
"Product"
On Error GoTo 0
.Close SaveChanges:=False
End With

'Delete the file
Kill TempFilePath & TempFileName & FileExtStr

With Application
.ScreenUpdating = True
.EnableEvents = True

Can anyone help?

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default "Send Email" macro to multiple addresses

Hi LKP

See
http://www.rondebruin.nl/mail/tips1.htm

--

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


"LKP" wrote in message ...
I am trying to get a send email button to send emails to multiple addresses.
I can get it to work for one address, but I don't know how to do multiples.
Here's the code:

wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr
Set wb2 = Workbooks.Open(TempFilePath & TempFileName & FileExtStr)

With wb2
On Error Resume Next
.SendMail ", _
"Product"
On Error GoTo 0
.Close SaveChanges:=False
End With

'Delete the file
Kill TempFilePath & TempFileName & FileExtStr

With Application
.ScreenUpdating = True
.EnableEvents = True

Can anyone help?

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?

  #3   Report Post  
Posted to microsoft.public.excel.programming
LKP LKP is offline
external usenet poster
 
Posts: 19
Default "Send Email" macro to multiple addresses

Sweet! Thanks Ron!

"Ron de Bruin" wrote:

Hi LKP

See
http://www.rondebruin.nl/mail/tips1.htm

--

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


"LKP" wrote in message ...
I am trying to get a send email button to send emails to multiple addresses.
I can get it to work for one address, but I don't know how to do multiples.
Here's the code:

wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr
Set wb2 = Workbooks.Open(TempFilePath & TempFileName & FileExtStr)

With wb2
On Error Resume Next
.SendMail ", _
"Product"
On Error GoTo 0
.Close SaveChanges:=False
End With

'Delete the file
Kill TempFilePath & TempFileName & FileExtStr

With Application
.ScreenUpdating = True
.EnableEvents = True

Can anyone help?

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default "Send Email" macro to multiple addresses

Oops

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?


You can change the security

Use the shortcut to go to that dialog

Alt tms



--

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


"LKP" wrote in message ...
Sweet! Thanks Ron!

"Ron de Bruin" wrote:

Hi LKP

See
http://www.rondebruin.nl/mail/tips1.htm

--

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


"LKP" wrote in message ...
I am trying to get a send email button to send emails to multiple addresses.
I can get it to work for one address, but I don't know how to do multiples.
Here's the code:

wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr
Set wb2 = Workbooks.Open(TempFilePath & TempFileName & FileExtStr)

With wb2
On Error Resume Next
.SendMail ", _
"Product"
On Error GoTo 0
.Close SaveChanges:=False
End With

'Delete the file
Kill TempFilePath & TempFileName & FileExtStr

With Application
.ScreenUpdating = True
.EnableEvents = True

Can anyone help?

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?


  #5   Report Post  
Posted to microsoft.public.excel.programming
LKP LKP is offline
external usenet poster
 
Posts: 19
Default "Send Email" macro to multiple addresses

Thanks, Ron. Do you know how I can make a mcaro button conditional? I want
this "Send Email" button to one person if certain conditions are met and
another person if these conditions are not met.

"Ron de Bruin" wrote:

Oops

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?


You can change the security

Use the shortcut to go to that dialog

Alt tms



--

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


"LKP" wrote in message ...
Sweet! Thanks Ron!

"Ron de Bruin" wrote:

Hi LKP

See
http://www.rondebruin.nl/mail/tips1.htm

--

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


"LKP" wrote in message ...
I am trying to get a send email button to send emails to multiple addresses.
I can get it to work for one address, but I don't know how to do multiples.
Here's the code:

wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr
Set wb2 = Workbooks.Open(TempFilePath & TempFileName & FileExtStr)

With wb2
On Error Resume Next
.SendMail ", _
"Product"
On Error GoTo 0
.Close SaveChanges:=False
End With

'Delete the file
Kill TempFilePath & TempFileName & FileExtStr

With Application
.ScreenUpdating = True
.EnableEvents = True

Can anyone help?

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default "Send Email" macro to multiple addresses

You can use code like this in the macro to test a cell value


Dim ToStr As String

If LCase(Range("A1").Value) = "yes" Then
ToStr = "
Else
ToStr = "
End If

With wb2
On Error Resume Next
.SendMail ToStr, _
"Product"
On Error GoTo 0
.Close SaveChanges:=False
End With



--

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


"LKP" wrote in message ...
Thanks, Ron. Do you know how I can make a mcaro button conditional? I want
this "Send Email" button to one person if certain conditions are met and
another person if these conditions are not met.

"Ron de Bruin" wrote:

Oops

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?


You can change the security

Use the shortcut to go to that dialog

Alt tms



--

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


"LKP" wrote in message ...
Sweet! Thanks Ron!

"Ron de Bruin" wrote:

Hi LKP

See
http://www.rondebruin.nl/mail/tips1.htm

--

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


"LKP" wrote in message ...
I am trying to get a send email button to send emails to multiple addresses.
I can get it to work for one address, but I don't know how to do multiples.
Here's the code:

wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr
Set wb2 = Workbooks.Open(TempFilePath & TempFileName & FileExtStr)

With wb2
On Error Resume Next
.SendMail ", _
"Product"
On Error GoTo 0
.Close SaveChanges:=False
End With

'Delete the file
Kill TempFilePath & TempFileName & FileExtStr

With Application
.ScreenUpdating = True
.EnableEvents = True

Can anyone help?

Also, when I click on this button, a security warning pops up asking if I
want to enable the macros, which I do. How do I turn that pop up off?


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
Macro to send email to multiple addresses Mark M Excel Worksheet Functions 0 March 28th 07 12:12 AM
Excel Macro to email to addresses in "Contacts" Tab Appelq Excel Programming 7 August 14th 06 05:51 PM
copy/convert column email addresses Hyperlink "mailto:" excel97 daleman101 Excel Discussion (Misc queries) 3 November 3rd 05 01:21 PM
Email from Excel; MS warning "program is trying to send mail on your behalf" KR Excel Programming 2 July 11th 05 05:00 PM
VB code to "Send To" Multi addresses muzzas news Excel Programming 2 February 18th 05 01:12 PM


All times are GMT +1. The time now is 11:22 AM.

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

About Us

"It's about Microsoft Excel"