Hi guys,
I'm new here and sort of new to VBA as well.
I have a worksheet with two columns. Column A contains a ID number, and Column B contains a hyperlink path to the image.
I have also created a userform with a combobox and an imagebox. When I click on the combo box, it will show me the ID number and when selected, it should show me the corresponding image.
However, my problem right now is that the hyperlink path in Column B is an absolute path (K:\test\Images\image1.jpg). I would like a relative path so that when I switch computers (these files are all contained on my usb stick), they will still work.
I've tried going into properties and setting the Hyperlink Base to K:\test\Images\ and then in Column B just Inserting a Hyperlink with just the image file name. And for one night, the userform worked with the hyperlink base set and with just the image file name. Then it stopped working consequently. I'm not really sure how to proceed from here.
This is an image of what I have at the moment...as you can see it displays the full path selection properly but if I click on the other ID numbers no image shows up. Right now the file properties has a Hyperlink Base set to "K:\test\Images\", just so you are aware.
Excel Forum Post Image.jpgExcel Forum Post Image2.jpg
At any rate, this is the code I have at the moment, and it works for absolute paths, just not relative paths. I'm not sure what changed overnight.
Is there additional code I need to insert?Please Login or Register to view this content.
EDIT: For my combobox1 I have given a name to the rowsource in the properties settings. There are two names if you check under the formula tab>name manager. I used "imagetest" in this case which is the green highlighted area.
Thanks in advance,
remixboy.
Bookmarks