• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

(excel range to new mail) Loop and read range and copy those ranges into new email

Ranga Kumara

New Member
Dear All,
I am looking for advanced excel help on the workbook.

I need to send email to "supplier contacts" only when the "E" column is "x".

It doesn't work here.

Looking for help.

Thanks
Rgds
 

Attachments

  • Posted in Web.xlsm
    556.2 KB · Views: 9
It's a long program. Rather than making one of us try to figure it out from nothing, tell us exactly how it doesn't work. Like this: "In the Summary worksheet are two buttons. When I click on the one marked 'Send mail', it's supposed to prepare an email for each supplier that has 'x' in col E of the 'Supplier Contacts' worksheet. Intead, it displays an error message saying 'Error 1004: The object does not support this property or method'."

I don't, of course, mean that exact error message; in fact it may not display an error message at all. But what does it do? In detail, please.
 
No, I didn't ask what you want it to do. I asked what it DOES do. In what way (exactly) is it not working right? What happens when you run the program?
 
Well, I don't yet see clearly everything the program does. I've rewritten parts of it in my own coding style, to make it easier, and I have a couple suggestions:

1) Comment out the Send statement and run the program again. This will result in displaying to you each of the emails it sets up, rather than sending it, so you can more clearly see what it's doing. That may show you only one email but not why, but it's a step in the right direction.

2) Step through the program one statement at a time using the <F8> key. You can see exactly what the program is doing at each point; usually this reveals the problem. Not always.

One thing I do notice, that I suspect is the cause of your problem: You create oMail outside the loop, just one time. After you send that email inside the loop, I think there is no more oMail object to operate on. I may be mistaken, but I think you need to create oMail inside the loop, creating one email object for each email to be sent.
 
Back
Top