+ Reply to Thread
Results 1 to 11 of 11

Excel changed my hyperlinks destinations on Auto- save

  1. #1
    Registered User
    Join Date
    01-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Excel changed my hyperlinks destinations on Auto- save

    Hi there,
    I use an Excel spreadsheet to list Recipes. When I click on one of the recipe names in the spreadsheet a Hyperlink opens MS Word and displays the actual recipe.
    The Spreadsheet is contained in a directory called "COOKBOOK" off the C drive root directory. That directory also contains a folder called Recipes which is full of the actual MS Word recipes.
    e.g. C:\COOKBOOK\RECIPES
    This all worked fine for years until my computer crashed recently whilst I was using my "Recipe Book". When I opened the spreadsheet again Excel had "auto-saved" my work. I saved it as my original Recipe Book however, when I opened it again, none of the hyperlinks worked. I found the reason was that the hyperlink destination was changed to some other directory which did not contain the folder called "Recipes".
    e.g. C:\Documents and Settings\xxxxxxx xxxx\Application Data\Microsoft\Excel
    As a temporary measure I copied my Recipes folder and pasted it in the new location specified by the corrupted hyperlinks.
    e.g. C:\Documents and Settings\xxxxxxx xxxx\Application Data\Microsoft\Excel\Recipes
    This of course works however, I would like to restore everything back to its original location and destination.
    I have hundreds of recipes in my Recipes folder and therefore there are also hundreds of hyperlinks in my "Cookbook" spreadsheet.
    It would be very time consuming to redo each hyperlink individually. I feel that since Excel changed my hyperlinks of its own accord there must be an easy way of restoring them back to their original location/destination. Is this at all possible? or, do I have to start changing them back one at a time?
    If anyone can help me and give me step by step instructions on how to do this I would be very grateful and I thank you.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Excel changed my hyperlinks destinations on Auto- save

    Make sure your files are in the destination where you want them.

    Then go to DATA > EDIT LINKS. If you have links to external files, hopefully you will find this option not disabled and can go in and CHANGE SOURCE.
    http://screencast.com/t/u4PG6A8TBu


    You may have to Google up to find where that is located in Excel 2003.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Excel changed my hyperlinks destinations on Auto- save

    Hello Jerry,
    Thank you for your quick reply. However, "Edit Links" is not available, it is greyed out.
    Any other suggestions?
    Regards,
    Maltese Falcon

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel changed my hyperlinks destinations on Auto- save

    Try running this code on a copy of your workbook which is in your C:\COOKBOOK folder:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    01-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Excel changed my hyperlinks destinations on Auto- save

    Hello romperstomper,
    Thanks for the code but alas it does not work.
    It stops on the line:
    hLink.Address = ActiveWorkbook.Path & "\Recipes" & Mid$(hLink.Address, lastBack)
    It gives a message saying:
    Run-time error '5':
    Invalid procedure call or argument.
    I'm no good with VBA code so I got no idea how to fix it.
    Can you help?
    Thanks.
    Maltese Falcon

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel changed my hyperlinks destinations on Auto- save

    Can you try this version and tell me if you see a message, and what it says:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Excel changed my hyperlinks destinations on Auto- save

    Hello romperstomper,
    Thanks for the code but alas it does not work.
    It stops on the line:
    hLink.Address = ActiveWorkbook.Path & "\Recipes" & Mid$(hLink.Address, lastBack)
    It gives a message saying:
    Run-time error '5':
    Invalid procedure call or argument.
    I'm no good with VBA code so I got no idea how to fix it.
    Can you help?
    Thanks.
    Maltese Falcon

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel changed my hyperlinks destinations on Auto- save

    That appears to be a delayed duplicate post?

  9. #9
    Registered User
    Join Date
    01-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Excel changed my hyperlinks destinations on Auto- save

    Hello romperstomper,
    I found the following code which was posted by ARGK for someone else who was having the same problem as me some time ago .
    It actually worked and changed all my hyperlink paths to "C:\COOKBOOK\Recipes"
    However, what I have is hundreds of recipes with different titles in the folder called "Recipes".
    So, what I require is that it changes the hyperlinks to include the recipe name.
    Example: "C:\COOKBOOK\Recipes\Baked Salmon" or "C:\COOKBOOK\Recipes\Apple Cake" etc. etc.
    The name of each Recipe is in Excel in a sheet called "CONTENTS"
    When I click on one of the recipe titles there-in it opens a word document in the folder called "Recipes" which is the actual recipe.
    Can it be modified to include the names of the individual recipes instead of just the path to the folder containing the Recipes?
    I hope what I've written makes sense.
    I am no good at writing or modifying VBA code so any help is most appreciated..
    Below is a copy of the code I found:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 11-12-2014 at 10:29 PM. Reason: Added missing CODE tags.

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Excel changed my hyperlinks destinations on Auto- save

    Assuming the contents of the cell are the name of the word document, it would be something like this:
    Please Login or Register  to view this content.
    You may need to replace the .doc with .docx depending on the format of the word document.

  11. #11
    Registered User
    Join Date
    01-02-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Excel changed my hyperlinks destinations on Auto- save

    HI romperstomper, That seems to be what I needed. However, I had started to manually change the hyperlinks and I am about 80% of the way through. You also reminded me in your message that some of the recipe file names are different to those in the hyperlinks (I did that for ease of sorting of the various food groups).
    I thank you very much for your persistence in helping me with my problem.
    Regards,
    Maltese Falcon

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Multiple hyperlinks that have changed after Excel crashed
    By BEEJAYEL in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-15-2013, 10:59 AM
  2. Replies: 7
    Last Post: 06-14-2012, 09:44 AM
  3. My hyperlinks are being changed when I hit save in excel.
    By jenniferl in forum Excel General
    Replies: 4
    Last Post: 05-26-2008, 02:23 AM
  4. [SOLVED] Hyperlinks getting changed on save
    By Dennis Benjamin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2006, 11:50 PM
  5. Replies: 9
    Last Post: 08-01-2005, 08:05 AM

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