-1

I want to embed a picture into a file and found this on stackoverflow but cannot get it to work. There is probably something simple that I cannot find - get syntax error.

Insert(Filename:= C:\Users\chill\Desktop\picture.jpg, LinkToFile:= False, SaveWithDocument:= True)
Community
  • 1
  • 1
Chuck
  • 1
  • 3
  • possible duplicate of [VBA does not accept my method calling and gives Compile error: Syntax error](http://stackoverflow.com/questions/15040060/vba-does-not-accept-my-method-calling-and-gives-compile-error-syntax-error) – GSerg Jun 20 '15 at 19:46
  • 2
    you need double quotes around your filename and path – LinkBerest Jun 20 '15 at 19:53
  • That is what I had tried earlier and now and no luck..... – Chuck Jun 20 '15 at 20:04
  • did not send this......Insert(Filename:= "C:\Users\chill\Desktop\FireCorps.Black-White.Logo.jpg", LinkToFile:= False, SaveWithDocument:= True) – Chuck Jun 20 '15 at 20:05
  • then you need to expand your included code (edit the question) as `xlApp.activesheet.Pictures.Insert(...)` should insert a *linked* picture. If you want to embed it - [you'll have to do something different](http://stackoverflow.com/questions/17110425/vba-to-insert-embeded-picture-excel) – LinkBerest Jun 20 '15 at 20:37

1 Answers1

0

Try something a bit simpler

  ActiveSheet.Pictures.Insert ("C:\Users\davesexcel\Pictures\Picture 2.jpg")
Davesexcel
  • 6,896
  • 2
  • 27
  • 42