Eric Bauman
Eric Bauman

Reputation: 13

Saving image in Excel workbook

I am building an Excel 2010 workbook that will use images to represent boards plugging into slots. Currently, I am using LoadPicture to pull the image from the disk to use on the worksheet. But when I send the workbook to somebody, they get error messages unless I send the image files also. Is there a way to actually have the image files be a part of the workbook file so that I don't have to package the image files with the workbook?

Thank you for your help!

Upvotes: 0

Views: 832

Answers (1)

Gary's Student
Gary's Student

Reputation: 96791

When you get the picture, make sure the picture is saved with the document and not just a link:

Sub GetThePicture()
    ActiveSheet.Shapes.AddPicture _
        "c:\TestFolder\sample.jpg", _
            msoFalse, msoTrue, 100, 100, 70, 70
End Sub

Upvotes: 1

Related Questions