Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Cell/function manipulation

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Cell/function manipulation

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Excel Data manipulation Pros: Something like a Vlookup with a Sum Function vipjun Excel Worksheet Functions 4 June 9th 06 08:56 PM
Need Help with Cell Manipulation gm Excel Discussion (Misc queries) 2 January 21st 06 10:11 AM
For better Performance in VBA for Excel - Strings manipulation OR Objects manipulation vmegha Excel Programming 2 December 19th 05 12:14 AM
Data Manipulation FUNCTION daufoi Excel Worksheet Functions 4 June 4th 05 08:45 AM
Cell Manipulation Cr4z3[_2_] Excel Programming 1 September 30th 04 05:57 AM


All times are GMT +1. The time now is 10:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"