Link to home
Start Free TrialLog in
Avatar of sandramac
sandramac

asked on

Increase Image Size

Hello,

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)
    Charts.Add
 
    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
    Temporary_Chart.Paste
 
    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"
     Temporary_Worksheet.Delete
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sandramac
sandramac

ASKER

Thanks, that did the trick.