Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to send a workbook to a list of email addresses within the
workbook. When I use ActiveWorkbook.SendMail and list the recipients as values of cells withing the workbook, It's coming up with a 1004, unkown recipient name in list of recipients. How would i format the recipient section in the vb code to get rid of this error? Or is there a better way to do this all together (other than ActiveWorkbook.SendMail? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Graig
See http://www.rondebruin.nl/mail/tips1.htm Send to all E-mail addresses in a range Dim MyArr As Variant MyArr = Sheets("mysheet").Range("C1:C10") ..SendMail MyArr, "This is the Subject line" Send only to the visible Addresses in column C Dim rng As Range Dim Arr() As String Dim N As Integer Dim cell As Range Set rng = Sheets("Sheet1").Columns("C").Cells.SpecialCells(x lCellTypeConstants) ReDim Preserve Arr(1 To rng.Cells.Count) N = 0 For Each cell In rng If cell.EntireRow.Hidden = False And cell.Value Like "*@*" Then N = N + 1 Arr(N) = cell.Value End If Next cell ReDim Preserve Arr(1 To N) 'Use this then in the SendMail line .SendMail Arr, "This is the Subject line" -- Regards Ron de Bruin http://www.rondebruin.nl "Craig" wrote in message oups.com... I'm trying to send a workbook to a list of email addresses within the workbook. When I use ActiveWorkbook.SendMail and list the recipients as values of cells withing the workbook, It's coming up with a 1004, unkown recipient name in list of recipients. How would i format the recipient section in the vb code to get rid of this error? Or is there a better way to do this all together (other than ActiveWorkbook.SendMail? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to merge email addresses in excel with a document and send it? | Excel Discussion (Misc queries) | |||
Send different worksheets to different email addresses | Excel Discussion (Misc queries) | |||
Macro to send email to multiple addresses | Excel Worksheet Functions | |||
Can I send a doc to group of email addresses via a macro button? | Excel Discussion (Misc queries) | |||
Trying to send an email with body text, to a range of cells | Excel Discussion (Misc queries) |