+ Reply to Thread
Results 1 to 3 of 3

macro: insert picture based on workbook location, not picture root path.

  1. #1
    Registered User
    Join Date
    05-05-2012
    Location
    New Hampshire
    MS-Off Ver
    Excel 2007
    Posts
    52

    macro: insert picture based on workbook location, not picture root path.

    Hi all,
    I am looking for a way to make this code get the .jpg "front.jpg" of any folder the workbook may be in, the workbook will be moved from folder to folder and it needs to get the .jpg of the new folder when the workbook is moved. the "front.jpg" name will stay the same always, but the workbook location will not be in the same place, but the "front.jpg" will always be in the same folder as the workbook.

    Example: every time we start a new job we take a folder with the blank workbook and and other files from the new job and name the folder and workbook with the clients name. we place a .jpg picture of the "front" of the new job and place it in the newly named folder with the workbook and files. I have this macro that inserts the "front.jpg" picture on the new workbook but the path to the new .jpg needs to be changed each time on the macro. this is not practicle to do each new job. is there a way to have the path be set to the folder the workbook is in and not from the root path of the computer? like this( \\A New folder\FRONT.jpg")

    I also need the macro to unprotect the workbook run macro then protect workbook. ( I know I ask for a lot )

    Thanks to all who look into this for me!


    Please Login or Register  to view this content.
    Last edited by Cutter; 08-03-2012 at 07:45 AM. Reason: Replaced quote tags with code tags

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: macro: insert picture based on workbook location, not picture root path.

    Assuming you're referring to worksheet protection, try something based on:
    Please Login or Register  to view this content.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: macro: insert picture based on workbook location, not picture root path.

    @ NicksDad

    Please notice that code tags have been added to your post in place of the quote tags that you used (next button over in the tool bar). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

+ 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