+ Reply to Thread
Results 1 to 9 of 9

some images are empty in e-mail body

  1. #1
    Registered User
    Join Date
    07-23-2021
    Location
    Poland
    MS-Off Ver
    MS Office 2019
    Posts
    5

    Question some images are empty in e-mail body

    Hi all, I have VBA code where I send e-mails to x people (100-400) with y images (2-10). For creating images, I use:

    Please Login or Register  to view this content.
    And then in another sub I create temporaty sheets where I copy the data from pivots, past the data as tables and use these sheets in the loop. My loop filters every single person in each temporary sheet and creates images with code above. Then it embeds these images in e-mail body for that person. A part od code in the loop:

    Please Login or Register  to view this content.
    Story: I had been using it on my old computer with Excel 2016. It worked fine for some time, but then it started to send one of the images empty to around 10% of people. Then I received a new computer with Excel 2016, but I installed Excel 2019. I started to send e-mail from the new computer. It worked perfectly. But recently it started to send 1-2 images empty to around 10% of people. So I started to use again my old laptop and guess what - it works perfectly there

    That's why I know that the code is correct. It's not the most optimal/efficient, but it works. I also share files and macros with others and everyhing works for them.

    Have any of you an idea why such issue occurs? How to repair it? I'd be really grateful.

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,737

    Re: some images are empty in e-mail body

    I assume that you already checked that all pictures have been created.

    !LANG PL=ON! Witam na najlepszym XL forum !LANG PL=OFF!
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    07-23-2021
    Location
    Poland
    MS-Off Ver
    MS Office 2019
    Posts
    5

    Re: some images are empty in e-mail body

    Yes - images are created in the same folder as my Excel file. The most of the images is created normally, only some of them are empty - white rectangle.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,737

    Re: some images are empty in e-mail body

    Issue is then why JPG has not been generated properly not why is empty in email (because is/are 'empty' as generic).
    Continue blind shooting, make a smaller qty emails to send with smaller qty of picture, to analyse step by step to check that:
    Please Login or Register  to view this content.
    not referencing into single empty (standard white background color) cell / cells.

  5. #5
    Registered User
    Join Date
    07-23-2021
    Location
    Poland
    MS-Off Ver
    MS Office 2019
    Posts
    5

    Re: some images are empty in e-mail body

    Yes, of course, you're right - JPG has not been generated properly, I'm sorry, I didn't think about it.

    "make a smaller qty emails to send with smaller qty of picture" - thank you, I will try it.

    It's not referencing to empty cells - it should have filtered a person that data are there, even the size of image is the same as when I do it manually. It's just... white. When I run macro more than once, different images than previously are white, so it's totally random.

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,737

    Re: some images are empty in e-mail body

    I do not believe in random 'error'. I think it is problem somewhere on moment when macro attaching JPG and another is generated.
    As you said each email has 2-10 x JPGs attached and according to code each of them have the same name: person(X) & "_Table1_q".
    Try to add some unique random ID like:
    Please Login or Register  to view this content.
    and then name picture like:
    Please Login or Register  to view this content.
    or something like this to be sure that each created and added picture have unique name and it is not overwritten on whole process.
    Last edited by KOKOSEK; 07-26-2021 at 11:31 AM.

  7. #7
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,158

    Re: some images are empty in e-mail body

    Saving images using the Chart.Export method sometimes results in blank images. The problem seems to be at the time of Zakres.CopyPicture or .Chart.Paste.

    Artik

    PS
    Jaki ten świat mały.

  8. #8
    Registered User
    Join Date
    07-23-2021
    Location
    Poland
    MS-Off Ver
    MS Office 2019
    Posts
    5

    Re: some images are empty in e-mail body

    Kokosek, images have different names:
    • person(x) is different for each person
    • Table1 was just an example, each image has another name

    Artik, dzięki! :D
    Do you know the solution? What I could change there?

    Or maybe it's because of CPU's GHz?
    • Laptop without blank images: Intel Core i5, 2.4 GHz, logical processors 4, L1-L3 cache: 128 KB, 512 KB, 3 MB
    • Laptop with blank images: Intel Core i5, 1.6 GHz, logical processors 8, L1-L3 cache 2x bigger, 256 KB, 1 MB, 6 MB

  9. #9
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,158

    Re: some images are empty in e-mail body

    For many years I have not used a solution with the export of a chart to a file, if it is not necessary. Instead, I use a procedure that creates an EMF file (I'm too stupid to modify this code to save in other image formats). Your code after changes
    Please Login or Register  to view this content.
    Artik

+ 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. Replies: 1
    Last Post: 04-13-2016, 08:46 AM
  2. Macros for Mail Range/Selection in the body of the mail along with attachment
    By xenon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2015, 06:29 AM
  3. Wedding invitation in excel send mail with images on the mails body.
    By ruznemat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-03-2014, 11:04 AM
  4. E-mail drafer macro leaves the body of the mail blank.
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2014, 05:00 PM
  5. Mail Range/Selection in the body of the mail along with an attachment
    By johnny_canuck in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-27-2013, 05:52 AM
  6. 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
  7. Replies: 1
    Last Post: 07-22-2012, 09:26 AM

Tags for this Thread

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