• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Files stuck in Temp folder

Svmaxcel

Member
I have vba code to send excel range as an images using Ms outlook.
The image is saved in User/Temp folder, but the image is not deleted after sending mail.
if you see the last lines of the code, there is no code to delete the file.
excel is not overwritting the image file, instead its sending the same file which was saved earlier.

In short, I want the image file to be deleted from temp folder, so that for next time, a fresh image will be generated and sent via email
Sample attached.
 

Attachments

  • SendRangeAsImageInEmail.xlsm
    23.2 KB · Views: 4
Oh sorry. I go the naming wrong. you called it tmpImageName
Appreciate your help.
I checked it's creating a file tempo.jpg of approximately 3.8 MB(need to reduce that as well)
But its not deleted the file and same images are send everytime.
I deleted the file manually and ran the code and I was able to get correct report as an image.
As a wordaround I have used date to be the image file name.
 
Back
Top