Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Arguments for a filename

I have a sub that has an arguement for (FILE)...basically if a cell says
MIKE, I want it to open up the file MIKE.BMP. I have created the
arguement for FILE I just cant get it to recognize the path. Help is
greatly appreciated...

Obviously it is struggling on FILE.BMP

ActiveSheet.Pictures.Insert("C:\Documents and Settings\Me\My
Documents\My Pictures\FILE.BMP").Select


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Arguments for a filename

Hi Mike,

It's the path to the Picture that's required.
Try changing FILE.BMP to MIKE.BMP

regards,
Don.

"Michael Smith" wrote in message
...
I have a sub that has an arguement for (FILE)...basically if a cell says
MIKE, I want it to open up the file MIKE.BMP. I have created the
arguement for FILE I just cant get it to recognize the path. Help is
greatly appreciated...

Obviously it is struggling on FILE.BMP

ActiveSheet.Pictures.Insert("C:\Documents and Settings\Me\My
Documents\My Pictures\FILE.BMP").Select


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Arguments for a filename

Unfortunately that won't work... the folder has pictures of lots of
people and the name of the file is the name of each person. My sub
carries the "NAME" as an argument.I want to be able to run the sub after
names are typed in, and have it return the picture of the person by
Inserting that Pic into the file.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Arguments for a filename

Hi,

Assume that the NAME is "Fred"

Fname="Fred" & ".bmp" or,i f NAME returns "Fred" then
Fname=NAME & ".bmp"

ActiveSheet.Pictures.Insert("C:\Documents and Settings\Me\My
Documents\My Pictures\Fname").Select

Does that make semse ?

regards,
Don

"Michael Smith" wrote in message
...
Unfortunately that won't work... the folder has pictures of lots of
people and the name of the file is the name of each person. My sub
carries the "NAME" as an argument.I want to be able to run the sub after
names are typed in, and have it return the picture of the person by
Inserting that Pic into the file.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Arguments for a filename

I see what you are saying but its still not working for me...here's what
I got so far....thanks again.

Sub GetPic()
Call PicImport("A6", "FRED")
End Sub
Private Sub PicImport(Cell, Name)
If Range(Cell).Text = Name Then
Dim NameWithBMP
NameWithBMP = Name & ".bmp"
ActiveSheet.Pictures.Insert("C:\My Blah\My
Pictures\NameWithBMP").Select
Else: End If

End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Arguments for a filename

Hi again,

I'm not sure of your procedure for getting the picture. Where is this
Private Sub ?

If the name of the picture is on the activesheet, say in cell "A6", all you
need is the following in a standard module.

Sub GetPicture()
Dim Fname As String
Fname = Range("A6") & ".bmp"
ActiveSheet.Pictures.Insert ("C:\My Blah\My Pictures\NameWithBMP")
End Sub

If the path is correct and the picture is in the file, it will load.
I suggest you get the basic part as above working to start with and then
post back.

Regards,
Don

"Michael Smith" wrote in message
...
I see what you are saying but its still not working for me...here's what
I got so far....thanks again.

Sub GetPic()
Call PicImport("A6", "FRED")
End Sub
Private Sub PicImport(Cell, Name)
If Range(Cell).Text = Name Then
Dim NameWithBMP
NameWithBMP = Name & ".bmp"
ActiveSheet.Pictures.Insert("C:\My Blah\My
Pictures\NameWithBMP").Select
Else: End If

End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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
Too few arguments plore Excel Worksheet Functions 5 July 19th 12 02:36 PM
Too many arguments Nick Wakeham Excel Worksheet Functions 2 March 18th 09 06:19 PM
Cell("filename") doesn't update to new filename when do save as. Louis Excel Worksheet Functions 2 March 22nd 07 07:27 PM
set filename to <filename-date on open bob engler Excel Worksheet Functions 2 July 13th 06 05:11 AM
Saving filename same as import filename Matt Excel Programming 4 February 24th 04 03:01 PM


All times are GMT +1. The time now is 03:14 AM.

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

About Us

"It's about Microsoft Excel"