Hi , could someone pls advise the command for to insert picture to excel using vb command.

Dim img as image

how to mention location of file name , path directory .
what if the file name and path...

pls advise

Re: Command for insert picture

Andy Pope


This will insert an picture on to the sheet and position it over range
C3:F10. It also creates an object reference which you can use to manipulate the picture if required.

Code Snippet

Dim shpTemp As Shape

Set shpTemp = ActiveSheet.Shapes.AddPicture("C:\Temp\pic.bmp", _
True, True, _
Range("C3").Left, _
Range("C3").Top, _
Range("C3:F3").Width, _
shpTemp.Name = "MyPicture"