Avatar of sandramac
 asked on

Increase Image Size


I located this code that creates a image from a selected range of cells.  Trying to figure out how to increase the image size then save it as the .jpg.  Looking to double the size of the image that was pasted onto the temporary chart.

Dim FName As String
    Dim Temporary_Worksheet As Worksheet
    Dim Temporary_Chart As Chart
    Dim Temporary_Picture As Picture
    'Adding a temporary worksheet
    Set Temporary_Worksheet = Worksheets.Add
    'Adding a chart, this is just a holding area for the copied range (eventually)
    ActiveChart.Location Where:=xlLocationAsObject, Name:=Temporary_Worksheet.Name
    Set Temporary_Chart = ActiveChart
    'Copying my range
    Sheets("Sheet17").Range("A3:H17").CopyPicture Appearance:=xlScreen, Format:=xlPicture
    'Pasting it on top of chart
    Set Temporary_Picture = Selection
    'Placing some extra space around the image to keep things clean
    With Temporary_Chart.Parent
        .Width = Temporary_Picture.Width + 5
        .Height = Temporary_Picture.Height + 5
    End With
    FName = "C:\Users\Mac\SMART\" & StrData & "D" & ".jpg"
    Temporary_Chart.Export Filename:=FName, FilterName:="jpg"
Microsoft ApplicationsMicrosoft OfficeMicrosoft Excel

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Thanks, that did the trick.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes