save picture in a worksheet programmatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
i searched queries up to now and could not find anything about saving a
picture in a normal worksheet(not a chart) to a local directory as a gif/jpg
file programmatically.
please, can anybody help me?
 
why is it easy to insert a picture into worksheet but no way to save the same
picture
in a file directory?
i am sure there are people facing the same problem as i do. is there any way
to save the picture programmatically?
can anybody please help me?

thanks,
 
ANDY THANKS,
how do i create chart programmatically?
how do i put a picture into that chart programmatically?
how do i then save it?
i visited the link and downloaded the code but could not understand anything
from that code. can you please explain it in a more simple code please?

thanks again,
 
Try this, although you will still need to specify which shape and output
filename.

Sub ShapeExport()

Dim objCht As ChartObject
Dim shpTemp As Shape

' reference the thing you want to export
Set shpTemp = ActiveSheet.Shapes(1)

With ActiveSheet.ChartObjects.Add(1, 1, 10, 10)
.Width = shpTemp.Width + 2
.Height = shpTemp.Height + 2
shpTemp.Copy
With .Chart
.Paste
With .ChartArea
With .Border
.Weight = 2
.LineStyle = 0
End With
.Interior.ColorIndex = xlNone
End With
' filename and folder
.Export "C:\MyImage.gif"
End With
.Delete
End With
End Sub

Cheers
Andy
 
Back
Top