1. Welcome to Chandoo.org Forums. Short message for you

    Hi Guest,

    Thanks for joining Chandoo.org forums. We are here to make you awesome in Excel. Before you post your first question, please read this short introduction guide. When posting or responding to questions please remember our values at Chandoo.org are: Humility, Passion, Fun, Awesomeness, Simplicity, Sharing Remember that we have people here for whom English is not there first language and we need to allow for this in our dealings.

    Yours,
    Chandoo
  2. 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...

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

Picture format

Discussion in 'VBA Macros' started by Svmaxcel, Oct 10, 2018.

  1. Svmaxcel

    Svmaxcel Member

    Messages:
    81
    When I copy a table and a chart in excel and paste it as Bitmap in Ms outlook the image is crisp and clear.
    When I paste it as Windows Metafile, it's blurred and not crisp.

    If there any way, I can paste data as Bitmap in Outlook via Excel vba
  2. Logit

    Logit Active Member

    Messages:
    279
    You can copy the data, paste it into PAINT and save it as a BMP file. Then insert the BMP file into Outlook.
    Svmaxcel likes this.
  3. Svmaxcel

    Svmaxcel Member

    Messages:
    81
    Great, but how via VBA
    However it would be better if its pasted in Outlook via Bitmap directly.
    Our organisation has blocked Paint
  4. Logit

    Logit Active Member

    Messages:
    279
    Well ... here is a macro to convert a range to a BMP file :

    Code (vb):
    Option Explicit

    Sub Example1()
    Dim i As Integer
    Dim intCount As Integer
    Dim objPic As Shape
    Dim objChart As Chart

    'copy the range as an image
    Call Sheet1.Range("A1:E12").CopyPicture(xlScreen, xlPicture)

        'remove all previous shapes in sheet2
       intCount = Sheet2.Shapes.Count
            For i = 1 To intCount
                Sheet2.Shapes.Item(1).Delete
            Next i
        'create an empty chart in sheet2
       Sheet2.Shapes.AddChart
        'activate sheet2
       Sheet2.Activate
        'select the shape in sheet2
       Sheet2.Shapes.Item(1).Select
        Set objChart = ActiveChart
        'paste the range into the chart
       objChart.Paste
        'save the chart as a JPEG ... change path as needed
       objChart.Export ("C:\Users\My\Desktop\TestImage.bmp")
       
    End Sub
     
    Now you just need to paste the image into Outlook.
  5. Svmaxcel

    Svmaxcel Member

    Messages:
    81
    If I share the file with other users, then I have to tell everyone to save the Macro.
    That doesn't seems to be a good option.

Share This Page