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("A 3:H17").Co pyPicture 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
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,
Set Temporary_Chart = ActiveChart
'Copying my range
Sheets("Sheet17").Range("A
'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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER