Inserting an image from Windows Explorer

LarryM

Board Regular
Joined
Dec 27, 2005
Messages
57
Hello again, I'm a huge fan of this site and always try to search for my needs before posting. Unfortunately, I've been unable to find an answer.

I just need the VBA code that will insert a TIF file from a directory in Windows Explorer into a worksheet. I'll need to position it and resize the image too but I think I can figure that out.

For reference, let's just say the TIF files reside on C:\TIF Files.

Thanks in advance!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Here's an example

Code:
Sub piccy()
ActiveSheet.Pictures.Insert ("C:\TIF Files\pic.tif")
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
    .LockAspectRatio = False
    .Top = Range("C3").Top
    .Left = Range("C3").Left
    .Height = Range("C3").RowHeight
    .Width = Range("C3").Width
End With
End Sub
 
Upvote 0
So simple now that I see it. I know enough VBA to be dangerous. Never had any training.

Thank you very much!!!
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,176
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top