+ Reply to Thread
Results 1 to 7 of 7

Send a mail with a macro in Excel & keep the conditional formatting + picture in the body

  1. #1
    Registered User
    Join Date
    10-28-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    5

    Send a mail with a macro in Excel & keep the conditional formatting + picture in the body

    Hello everyone,

    First of all I'm new to this forum.

    I'm struggling with something, so I need your help on this.

    I have an excel which first of all generates some KPI's through a macro run on other data in the excel. These KPI's are calculated and put in a table with a fixed layout.
    Everyday these KPI's are calculated. To make this a bit more user-friendly and less time consuming I needed to automate this excel. The table with the KPI's needs to be send everyday to several people.

    I already managed to send the table with - let us say - the standard VBA-code, but the problem is that this code does not copy the conditional formatting I use in this table. The conditional formatting I use is a icon set based on the values in the cells.
    I already searched the web and found alternative methods like with HTML, but none of these work so far.
    There is also a picture in this table which needs to be included into the body of the mail. I also found a way to solve through an attachment in the mail, but it needs to be in the body of the mail. If you try it manually copying the table and open a new mail and paste as picture then it works, the problem is to get this automated.

    Is there anyone who could help me with this??
    Last edited by Fred DJ; 10-28-2013 at 04:34 PM.

  2. #2
    Registered User
    Join Date
    10-28-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Send a mail with a macro in Excel & keep the conditional formatting + picture in the b

    28-10-2013 21-44-01.png

    This the excel table I need to send.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Send a mail with a macro in Excel & keep the conditional formatting + picture in the b

    Hi Fred

    Pictures are of little value. Attach a File that is of the same structure as your actual file...change any proprietary information.

    Is your Email Client Outlook?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    10-28-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Send a mail with a macro in Excel & keep the conditional formatting + picture in the b

    Hi and thanks for the reply.

    In attachment you find my excel file. The fixed layout with all the data in the tab 'New Daily FPY' needs to be send in a mail (with button the START-tab).
    So the exact layout: borders, colors, values, conditional formatting (icon set) + image needs to be in the body of the mail.

    I use Excel 2010 and Outlook 2010.

    You will also see i tried several macros to do so, but none is giving me the desired result.

    Thanks.
    Attached Files Attached Files

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Send a mail with a macro in Excel & keep the conditional formatting + picture in the b

    Hi Fred

    Try this Code...it appears to work as required...run MailTest
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-28-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Send a mail with a macro in Excel & keep the conditional formatting + picture in the b

    Thanks a lot jaslake.
    It tried it quickly and it seems to be working.
    The only thing now is that the email is quite large, but I managed to solve this by changing from BMP (bitmap) to PNG.
    I'll keep you posted on the final outcome.

  7. #7
    Registered User
    Join Date
    10-28-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    5

    Thumbs up Re: Send a mail with a macro in Excel & keep the conditional formatting + picture in the b

    Hi,

    I was able to fully adjust and test it. It works great, very pleased with the result.
    With using PNG instead of BMP or JPG, you can even reduce the size of the mail dramatically.

    So jaslake, thank you very much for the help !

    Fred DJ

+ 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. [SOLVED] Send an email notification to Lotus mail if shared excel 2007 updated by any body?
    By priya06manohar@gmail in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-08-2013, 01:29 PM
  2. [SOLVED] Excel can send mail with multiple cells info as email body and subject, befr 3 day of due
    By ExcelUser2707 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2013, 04:29 AM
  3. Send e-mail with image on body (.html) on e-mail manager <> outlook
    By mariotnc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2012, 09:28 PM
  4. Word Format as Body of mail using Send mail
    By andy_iyeng in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-19-2012, 05:04 AM
  5. [SOLVED] Excel 2003 / Send To / Mail Recipient / body text is removed
    By jmaynard2 in forum Excel General
    Replies: 1
    Last Post: 03-15-2005, 11:06 PM

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