View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Lazzaroni Lazzaroni is offline
external usenet poster
 
Posts: 55
Default InserPictureInRange method for excel VBA

ActiveSheet.Shapes.AddPicture
"http://www.google.com/intl/en_ALL/images/logo.gif", msoTrue, msoFalse, 0, 0,
10, 10

I used to use that to link images (not embed) in Excel 2003 spreadsheets. In
Excel 2003 you could use AddPicture and a URL in place of a local image
filename, and you could enable and disable linking and embedding. That
prevented your workbook from choking on embedded images.

With the advent of Excel 2007 AddPicture no longer accepts URLs in place of
local image file names. See:

http://support.microsoft.com/kb/928983/en-us

Now I use the following code, which does not allow for enabling linking and
disabling embedding, that I am awa

Dim MyPicture As Shape
Set MyPicture = ActiveSheet.Shapes.AddShape(msoShapeRectangle, 0, 0, 10, 10)
MyPicture.Fill.UserPicture "http://www.google.com/intl/en_ALL/images/logo.gif"

UserPicture can accept a URL in place of a local image file name, but I
haven't figured out how to enable linking and disable embedding when using
UserPicture.

Can anyone suggest a way to insert an image from either a local file name or
a URL and still enable linking and disable embedding?

Thanks for your help.