PDA

View Full Version : Send email via vba



alfiebaby
08-28-2013, 07:10 AM
this used to work then stopped

For Each e_address In Range("k28")
ActiveSheet.Hyperlinks.Add Anchor:=e_address, Address:="mailto:" & e_address.Value, TextToDisplay:=e_address.Value
Next
Range("k28").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True

Run-bme error ‘-2147221020 (800401e4)’:
The address of this site is not valid. Check the address and try again.
Note that error message states ` site' when it should be an email address not a site that it should be referencing?

works only on my own email address and not on anyone else's, used to work. I have this code in a number of modules each reference a different cell depending on
what sheet i'm on, none of them work now. tried all same code on another machine and it works as is written above. does the e_address matter if it is in many a module?

using thunderbird client

mrojas
10-20-2013, 12:53 PM
I've tested your code with Excel and Outlook 2007 and it worked fine, with the exception that I changed the range from k28 to A1:A6. In addition, when I run the code it only create one email although I had six addresses.
Not sure where to go from here.