+ Reply to Thread
Results 1 to 16 of 16

Email from default client

  1. #1
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Email from default client

    hi...i am wanting to send a single email from a list if addresses from cells in a single column...i have figured out the code to add the range of addresses but my only problem is that with this code it uses outlook...my default email is gmail and i can send email from single cells this way, however when i run the code it opens it in outlook..i do not now how to change the code i have to open gmail instead of outlook..thank you for your help.
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 02-03-2010 at 02:18 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Email from default client

    Hello tate2133,

    Welcome to the Forum!

    To make your posts easier to read, copy, and edit please wrap your code. I did it for you this time. Here is how you can do it next time.

    How to wrap your Code using the # icon
    1. Select all your code using the mouse.
    2. Click on the # icon on the toolbar in the Message window. This will automatically wrap the text you selected with the proper Code tags to create a Code Window in your post.

    To manually wrap your code, use these Bulletin Board Code Tags
    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] at the end of the last line.


    To learn more about BB codes used in this forum, just click on the link below...

    Bulletin Board Codes Tags
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    Thank you, I will make sure I do that next time

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Email from default client

    Hello tate2133,

    This macro uses CDO (Collaboration Data Objects) to send the emails directly to Gmail. You will need to add your email address and password to the macro. You will also need to change the worksheet name and starting cell of the email addresses to what your are using. These have been marked in red.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    sweet, thank you...i copied, changed the areas needed and ran...its giving me a "compile error: wrong number of arguments or invalid property assignment" when it gets to here:

    IIf(RngEnd.Row < Rng.Row, Rng, Wks, Range(Rng, RngEnd))

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Email from default client

    Hello tate2133,

    My typing skills are not the best. That should be a period after Wks not a comma.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    Yep, doesnt stop there anymore, however, im getting a "run-time error '9': subscript out of range" now?

  8. #8
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    check that...this is the error it is giving
    Automation error:
    Cannot modify or delete an object that was not added using COM+ Admin SDK

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Email from default client

    Hello tate2133,

    I have never encountered that error before. What version of Windows are you running the macro on? Maybe your version of Windows doesn't have the CDO library.

  10. #10
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    I am using Windows 7

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Email from default client

    Hello tate2133,

    I don't have Windows 7 yet. I'll need to do some research on creating OLE objects in Windows 7 to answer your question.

  12. #12
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    Thank you, I appreciate it

  13. #13
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Email from default client

    Hello tate2133,

    This seems to be a general error statement with no specific cause or at least one that anyone is aware of. I did not think to ask if you have a firewall enabled or are attempting to do this through a network or have anti-virus software running on your machine. Any of these can interfere with sending emails via CDO. Form what I have uncovered about Windows 7 the cdosys.dll ships with the product. Which means, in theory, it should work.

  14. #14
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    thank you for all your help....I cannot for the life of me figure it out...im sure windows 7 is capable of cdo....that code i pasted...i was from another forum on this same site...a kid wrote it, said it was messy but it works...and it does work...exactly what i need, only exception is it opens in outlook instead of gmail....i was playing around with it trying to insert cdo in there, but have no idea what im doing..its been 8 years since i took VB...thanks

  15. #15
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    Thanks for all the help...i ended up using the code and then just tying my gmail to outlook...much appreciatd

  16. #16
    Registered User
    Join Date
    02-03-2010
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    11

    Re: Email from default client

    How do i mark [solved]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1