+ Reply to Thread
Results 1 to 10 of 10

Remove the error and clean my code to send mail automatically from excel

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Remove the error and clean my code to send mail automatically from excel

    I dont think you can do that.
    If you want to send an email without Outlook being opened, you will need to use the SMTP object or the CDO object.

  2. #2
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Remove the error and clean my code to send mail automatically from excel

    Hello jason_lee_91,
    Thank you for guidance. Please tell me which is the best option to send mail from excel without opening outlook automatically. Is there anything wrong in code? Tell me the setting to achieve the target.

    Waiting for your guidance.

    Thanking you in anticipation.

    Mukesh

  3. #3
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Remove the error and clean my code to send mail automatically from excel

    One thing I myself might do differently is instead of using On Error GoTo lblLoop, I would probably find out why it throws an error and use an if statement.
    Its just that currently, any errors caused by that formula would stop the email from being sent.

    there could be many things that trigger an error.
    It could just be that the input was in the wrong format.
    If thats the case, maybe the emails will never get sent and you might not know that there is actually a problem in your code.
    But thats entirely just my opinion/preference.

    Also, I have heard that people feel that GoTo statements are slightly harder to read in many cases.

  4. #4
    Forum Contributor
    Join Date
    12-15-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    672

    Re: Remove the error and clean my code to send mail automatically from excel

    Hello jason_lee_91,
    As per your suggestion it's not a safer way. At present only I have to open the outlook before opening excel file to send the message. It's better than inserting password in code. I think that I shall continue the present code and system to open outlook first then excel.

    Give me your opinion on it so that I will close this thread.

    Thank you.

    Mukesh

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Code to send an e-mail. Don't send if attachment not found
    By thedon_1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2012, 05:41 PM
  2. Send mail from excel sheet to oulook automatically
    By hai_krk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-21-2009, 03:42 AM
  3. Automatically send Mail for Due Dates from Excel
    By Kohinoor in forum Excel General
    Replies: 1
    Last Post: 03-20-2009, 12:10 PM
  4. [SOLVED] Can excel automatically send e-mail when particular cell is change
    By ivica in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2006, 05:55 PM
  5. [SOLVED] Macro to automatically open a website or send an e-mail in excel
    By Byron in forum Excel General
    Replies: 3
    Last Post: 04-07-2006, 04:10 AM

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