+ Reply to Thread
Results 1 to 6 of 6

issue with sending mail thru xls

  1. #1
    Forum Contributor
    Join Date
    06-04-2006
    Posts
    132

    issue with sending mail thru xls

    Hi,

    just wonder if i could get some help here. I was trying to get the excel spreadsheet to send a selected sheet out via email. The following is my code

    ActiveWorkbook.SendMail "[email protected]", "testing", False

    How do i pick which sheet to send? is it doable?

    Another question i need some help with is the warning pop-up dialogbox that come up automatically after executing the above piece of code.

    It's from the outlook that said "A program is trying to automatically send email on your behalf. Do you want to allow this?..."

    Is there any way of turning this warning off?

    Thank you in advance
    Last edited by associates; 09-03-2007 at 02:46 AM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning associates

    It is not possible to directly send just one sheet - you have to e-mail a file. However, you can save a sheet to a new file and send that. Ron de Bruin has some code here showing you just how to do it :

    http://www.rondebruin.nl/mail/folder1/mail2.htm

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    associates,

    You can use this small piece of software

    http://www.contextmagic.com/express-clickyes/

    which sits in the sytem tray and overcomes the problem you are having.
    Hope this helps

    Seamus

  4. #4
    Forum Contributor
    Join Date
    06-04-2006
    Posts
    132
    Thank you, SOS and Dominicb, for your replies.

    The codes that you pointed out thru the link works and the clickyes software also works.

    However, my question here is whether it'd be possible not to use the software "clickyes" installed. I mean i prefer to use that i'm aware of or know how to take control of it.

    I'm sort of in a dilemma. Don't know what to do. It's certainly not a good practice to disable the warning security from Outlook when sending automated email from the excel spreadsheet (only If i know how to disable it). because i don't want any incoming e-mails to my outlook that may contain virus that could trigger itself to send mails out from outlook without me knowing it.

    But at the same time, i don't want to scare admin people by letting the warning security from outlook show up for every mails to be sent out automatically either.

    If i disable the outlook warning security, that would be a greater risk, wouldn't it?

    If i want to disable it, how do i go about doing that? so that i don't see it popping up for every single outgoing mails sent by excel via outlook.

    Thank you in advance

  5. #5
    Registered User
    Join Date
    08-18-2007
    Posts
    54

    examples

    Please find attached some examples of using excel only to send email using macros.

    You may need to add excel.exe to your firewall lsit for this to work.

    Hope this helps
    Sam
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    06-04-2006
    Posts
    132
    Thank you for your replies,

    I ended up combining the two codes together, sending a copy of the sheet and the CDO code. It works fine but there is a slight problem here. When a mail is sent out, i enclose an attachment to it. The problem here is the first person gets one attachment file, the second person gets two attachment files, the 3rd gets 3 attachment files. This is not right. It keeps on appending the previous to the current one. That's why it keeps on adding depending on the number of people to be sent to. What's right is each persons should get only one attachment file. There is something wrong in the code i may have overlooked.

    Here is the code

    Please Login or Register  to view this content.
    I even tried to store the filename into the array, myattach but to no avail.

    wonder what i have done wrong here.

    Thank you in advance

+ 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