Adding OLE objects from VBA in Excel

N

Neil

I want to generate a number of images of a sheet from code. I can
create the image boxes exactly as I want but CANNOT work out how to
add the pictures from code. Can anyone help me please?
 
C

Chip Pearson

Neil,

Try something like


Dim WS As Worksheet
Dim SHP As Shape
Set WS = ActiveSheet
With WS.Range("C3")
Set SHP = WS.Shapes.AddPicture(Filename:="C:\wires.jpg",
linktofile:=False, _
savewithdocument:=True, Top:=.Top, Left:=.Left, Width:=100,
Height:=100)
End With



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top