Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello again,
Trying to pull pictures based of a value in a cell. They should be named the same. For example, in cell C2, the value is A123. So this process should retrieve C:\Images\A123.bmp However, I receive the error 'The specified file wasn't found'. I've played around with it for a while, and tried using various code I found through searching here but I cannot get it to work. Thoughts? Code below. Dim s As Shape With [E2] Set s = .Parent.Shapes.AddPicture( _ "C:\Images\'" & Range("C2").Value & "'"".bmp", _ True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.45, msoTrue .ScaleWidth 0.48, msoTrue End With |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try:
Dim s As Shape With [E2] Set s = .Parent.Shapes.AddPicture( _ "C:\Images\" & Range("C2").Value & ".bmp", _ True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.45, msoTrue .ScaleWidth 0.48, msoTrue End With Regards Trevor "mazzarin" wrote in message oups.com... Hello again, Trying to pull pictures based of a value in a cell. They should be named the same. For example, in cell C2, the value is A123. So this process should retrieve C:\Images\A123.bmp However, I receive the error 'The specified file wasn't found'. I've played around with it for a while, and tried using various code I found through searching here but I cannot get it to work. Thoughts? Code below. Dim s As Shape With [E2] Set s = .Parent.Shapes.AddPicture( _ "C:\Images\'" & Range("C2").Value & "'"".bmp", _ True, True, .Left, .Top, .Width, .Height) End With With s .ScaleHeight 0.45, msoTrue .ScaleWidth 0.48, msoTrue End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help Excel Data manipulation Pros: Something like a Vlookup with a Sum Function | Excel Worksheet Functions | |||
Need Help with Cell Manipulation | Excel Discussion (Misc queries) | |||
For better Performance in VBA for Excel - Strings manipulation OR Objects manipulation | Excel Programming | |||
Data Manipulation FUNCTION | Excel Worksheet Functions | |||
Cell Manipulation | Excel Programming |