troubleshooting Question

Increase Image Size

Avatar of sandramac
sandramac asked on
Microsoft OfficeMicrosoft ExcelMicrosoft Applications
2 Comments1 Solution490 ViewsLast Modified:
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
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros