Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Too few arguments | Excel Worksheet Functions | |||
Too many arguments | Excel Worksheet Functions | |||
Cell("filename") doesn't update to new filename when do save as. | Excel Worksheet Functions | |||
set filename to <filename-date on open | Excel Worksheet Functions | |||
Saving filename same as import filename | Excel Programming |