S
StargateFan
I found code to export a range of cell, B1:B4, to an image on the
desktop and it works just great. I need to finetune the macro a bit
and had posted in the programming ng but there's been no answer which
only happens when the answer isn't widely known, I've found. I'm
guessing you charting folks might have a much better handle on the
issue so trying here, if I may.
Here is the macro I found:
'2011-08-17 19:27:39
(http://vbadud.blogspot.com/2010/06/how-to-save-excel-range-as-image-using.html)
Sub Export_Range_Images()
' ==========================================
' Code to save selected Excel Range as Image
' ==========================================
Dim oRange As Range
Dim oCht As Chart
Dim oImg As Picture
Set oRange = Range("B1:B4")
Set oCht = Charts.Add
oRange.CopyPicture xlScreen, xlPicture
oCht.Paste
oCht.Export Filename:="P:\0DESKTOP\TOD+TOM.gif", Filtername:="GIF"
End Sub
The process works great, it's just that I get both the cells needed,
and what looks like some sort of chart background, which is not
needed. I google xlScreen and xlPicture to see if problem lay there
but that doesn't seem to be the cause. Does anyone know how to limit
export to the cell range involved?
Thanks.
desktop and it works just great. I need to finetune the macro a bit
and had posted in the programming ng but there's been no answer which
only happens when the answer isn't widely known, I've found. I'm
guessing you charting folks might have a much better handle on the
issue so trying here, if I may.
Here is the macro I found:
'2011-08-17 19:27:39
(http://vbadud.blogspot.com/2010/06/how-to-save-excel-range-as-image-using.html)
Sub Export_Range_Images()
' ==========================================
' Code to save selected Excel Range as Image
' ==========================================
Dim oRange As Range
Dim oCht As Chart
Dim oImg As Picture
Set oRange = Range("B1:B4")
Set oCht = Charts.Add
oRange.CopyPicture xlScreen, xlPicture
oCht.Paste
oCht.Export Filename:="P:\0DESKTOP\TOD+TOM.gif", Filtername:="GIF"
End Sub
The process works great, it's just that I get both the cells needed,
and what looks like some sort of chart background, which is not
needed. I google xlScreen and xlPicture to see if problem lay there
but that doesn't seem to be the cause. Does anyone know how to limit
export to the cell range involved?
Thanks.