+ Reply to Thread
Results 1 to 3 of 3

Lookup Picture issues and error messages

  1. #1
    Registered User
    Join Date
    01-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Question Lookup Picture issues and error messages

    I have created a spreadsheet, which for one section I wanted to have a corresponding image for each option in a drop down menu. Therefore after some research I came across the following tutorial:
    http://www.youtube.com/watch?v=MzF_5DXhqbs

    I got this working well; however I have since come across two problems I cannot solve. The VBA is:
    Please Login or Register  to view this content.
    This is on my USB, and it works fine when I'm on my computer. However if I open it in another computer I get the following message:

    run-time error '7':
    out of memory

    Now I can solve the problem by changing the K: section to the name of the drive I put my USB in, however this is rather frustrating and surely unnecessary. My excel document is in the RGR1 folder, and therefore I thought I would be able to just have NewPic = "GSU\Images\" & Range("H8").Value But this results in the same message presenting itself.

    Therefore my first question is how can I solve this issue?

    Secondly for my worksheet I wish to have two of these images and drop down menu sections, so being relatively new to VBA I thought I would be able to just duplicate them and change the cell references. However that resulted in this message:

    Ambiguous name detected: Worksheet_Change

    So would I be right that I need to actually combine these two macros (is that what you refer to the section of code as? sorry getting a bit confused with all the terminology). And if so how on Earth would I go about doing this?

    Any help on these matters would be greatly appreciated.

    Thanks

    Rob.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Lookup Picture issues and error messages

    Rob,

    If the workbook is in the RGR1 folder on the USB drive, you can get the path to the image file using:
    Please Login or Register  to view this content.


    For having two drop-down sections, assuming they both use the same layout (H7 changes, H8 contains the image name, if the second cell is P12, then P13 contains the image name), you should be able to use the following:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    01-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Lookup Picture issues and error messages

    Thank you, that's fantastic!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1