I have some VBA code that finds named ranges throughout a workbook and saves those ranges as images.
The code works great, but the resolution of the images is not that great. If you do a manual screen capture of the range and put that image next to the image created from the macro, there is a noticeable difference in the resolution.
I've read online that Format:=xlBitmap will create a high resolution image, but is there a way to increase the resolution so that the text in the image is easier to read?
The code works great, but the resolution of the images is not that great. If you do a manual screen capture of the range and put that image next to the image created from the macro, there is a noticeable difference in the resolution.
I've read online that Format:=xlBitmap will create a high resolution image, but is there a way to increase the resolution so that the text in the image is easier to read?
VBA Code:
Sub Export_Pictures()
Dim Nm As Name
Dim rgExp As Range
For Each Nm In Names
If Nm.Name Like "Week*" Then
Range(Nm).CopyPicture Appearance:=xlScreen, Format:=xlBitmap
With ActiveSheet.ChartObjects.Add(Left:=Range(Nm).Left, Top:=Range(Nm).Top, Width:=Range(Nm).Width, Height:=Range(Nm).Height)
.Name = "TempArea"
.Activate
End With
ActiveChart.Paste
ActiveSheet.ChartObjects("TempArea").Chart.Export "C:\Users\user\Dropbox\" + Nm.Name + ".png"
ActiveSheet.ChartObjects("TempArea").Delete
End If
Next
End Sub
Last edited by a moderator: