mass email i keep getting errors can some1 HELP ?? ? ? CLICK HERE !!

eric86vabeach

New Member
Joined
Jan 29, 2014
Messages
23
i keep getting an error can some1 look at this and help me fix this code?

or help me with the notes in this code







Sub sendemail(what_address As String, subject_line As String, mail_body As String)





Dim olapp As Outlook.Application
Set olapp = CreateObject("outlook.application")


Dim olMail As Outlook.MailItem
setolmail = olapp.CreateItem(olMailItem)

olMail.To = what_address
olMail.Sub = subject_line
olMail.Body = mail_body
olMail.Send





End Sub


Sub sendmassemail()
row_number = 2




Do
DoEvents
row_numbers = row_number + 1
Call sendemail(Sheet4.Range("BD" & row_number), "this is a test email", Sheet5.Range("BV2")) 'please read note at bottom about this line

Loop Until row_number = 6





End Sub

i would like cell "BQ1" type in the a cell # and it would say to the code grab the email from that cell and i think it would go where "this is a test email" goes?




thanks for your time and reading this
Eric
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,318
Perhaps something like this
Code:
Sub sendmassemail()
     row_number = Range("BQ1").Value
     Do
         DoEvents
         row_numbers = row_number + 1
         Call sendemail(Sheet4.Range("BD" & row_number), "this is a test email", Sheet5.Range("BV2")) 'please read note at bottom about this line

    Loop Until row_number >= 6
End Sub
 

eric86vabeach

New Member
Joined
Jan 29, 2014
Messages
23
Perhaps something like this
Code:
Sub sendmassemail()
     row_number = Range("BQ1").Value
     Do
         DoEvents
         row_numbers = row_number + 1
         Call sendemail(Sheet4.Range("BD" & row_number), "this is a test email", Sheet5.Range("BV2")) 'please read note at bottom about this line

    Loop Until row_number >= 6
End Sub


now i have error

Call sendemail(Sheet5.Range("BD" & row_number), "this is a test email", Sheet5.Range("$BV$2")) 'please read note at bottom about this line

object_work sheet failed
 

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,318
What is in BQ1?
Does that refer to an email address or the text of the message?
Where do you want the email sent? To the addresses in BD2 thru BD6 as in the OP code?

What is that "note at the bottom" that you want read?
 

Forum statistics

Threads
1,181,545
Messages
5,930,530
Members
436,744
Latest member
Dhudson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top