Im trying to loasd a pic of a userform using cell A1 as the referance for the file though i am going wrong somewhere.
Ant idears
ThanksPlease Login or Register to view this content.
I though ild post a new topic since its a diffrent problem
Im trying to loasd a pic of a userform using cell A1 as the referance for the file though i am going wrong somewhere.
Ant idears
ThanksPlease Login or Register to view this content.
I though ild post a new topic since its a diffrent problem
Last edited by D_Rennie; 06-21-2009 at 08:54 AM.
Hello D_Rennie,
Use the LoadPicture method to copy the picture from a file into a control.
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Thanks Leith Ross.
another questions though, After the sub has run the image will only appar if i go away from the form and then return (so after the sub i have to go to firefox then back to excel for the image to display). Does the form need to be refreshedd somehow.
Thankyou
Which version of Excel are you using?
What's the reason for dong this?
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
2007 Without any service packs
Reason, so i can store the path and file name in a cell and based on what a user enteres into combobox a picture related to that item can be displayed.
Last edited by D_Rennie; 06-21-2009 at 08:17 AM.
Is the image control on a userform?
what i done was,
using the code that yu gave me to fill the combobox ive added a textbox and then when your code runs ive set the textbox value 2 to the right and used the textbox value for setting the Variant and it works like a charm
I don't understand, why do yo need a textbox/ Are you loding an image to a userform?
well i used the Application.GetOpenFilename with that i can store the file path and name into a cell.
on another sub
If i use the cell value to set the Variant for some reason the picture will only display like i said earler.
Though if i change the textbox value to the cell vaule and then use the textbox value for setting the Variant it image loads straight away.
.
it all ties in with what you helped me with on the combobox.
so a user sets the 1st combobox (Your code runs) and then 2nd combobox is selected then the textbox value is set. all in turn showing the picture for the selections.
You should declare a variable to hold the path, then set that variable with getopenfile.
Have you looked at the DatabaseForm example which shows how to load images bsed on a Field in the dataset?
http://www.excel-it.com/vba_examples.htm
This is the workbook so far, Its kinda messy though.
lol
Thats pritty much what i was aming for,
I was trying to make this like a database. Though though databases seamed like a scary thing. So instred i bug the hell out of all of you.
I think some of my idears have been kinda sound.
Cheers ill take a real close look.
I like the way the row can be deleted and the thing with allowing admendments looks nice. the whole thing seams so simple when structured like that.
there is a error when i click the goto last record or try and find a record. or all things it points to Me.Image1.Picture = LoadPicture(imgFolder & sFileName & ".jpg").
Would the be a version thing.
Should i get a copy of 2003 and use that.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks