Adding OLE objects from VBA in Excel

  • Thread starter Thread starter Neil
  • Start date Start date
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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top