Search code examples
excelexcel-2007export-to-excelvba

Excel 2007 Display image from image path?


I would like to insert an image into a cell. The code below inserts it into a sheet:

            With wb.Sheets(1).Pictures.Insert("\\bk01fil0001\salesdb$\ImageUpload\NoImage.gif")
            .Left = wb.Sheets(1).Range("B2").Left
            .Top = wb.Sheets(1).Range("B2").Top
            .Width = wb.Sheets(1).Range("B2").Width
            End With

Solution

  • You can't insert a picture inside a cell: they always sit "on top" of the worksheet. Best you can do is position it over the required cell/range as you are already doing.