#1
|
|||
|
|||
Macro to change file path
Hi Again.
I have a question about creating some means of finding the filepath of existing links to one excel document and replacing with the filepath of a new source document. My document has over 200 links so using the standard links management tool would take forever. Essentially, I would like to create some sort of useform that would allow me to browse files on my computer and select the appropriate excel workbook to redirect the links to. I appreciate this may be a huge ask, but even a step in the right direction would be helpful. I am a novice at VBA in word and a beginner on VBA in excel, so my knowledge is basic. Thank you! |
#2
|
||||
|
||||
If you press Alt-F9 do all the links show up as field codes? If so, you can do a search and replace to amend the relevant part of the file path. Pay careful attention to the double backslashes to match the syntax correctly.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#3
|
|||
|
|||
Thanks Guessed.
That is what I do currently but its a bit long winded as a workaround. I would ideally like to make an idiot proof link tool that others can also use. I know there must be some code that I can use to make the re-linking of excel a straightforward process without potential for syntax errors. Cheers, John. |
#4
|
|||
|
|||
I have been searching the web and note in a previous post on another forum, Macropod proposed the following code to assist someone else with a similar problem here:
https://www.msofficeforums.com/word/...nal-files.html I cant get it working and wonder if there is anything that jumps out as problematic (I am on office 365? Thank you in advance... Quote:
|
#5
|
||||
|
||||
Since the code works just fine, you'll need to explain what problems you're having getting it to work...
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Hi Macropod.
What happens is nothing. I get the blue spinning wheel then excel freezes. I have to crash out of it to be able to carry on with what I am doing. I have 270 links in the document to the excel source book. Perhaps that is too many for this application? Cheers, John |
#7
|
||||
|
||||
It's not that there are too many, it's that updating so many links takes a long time. You might try:
a) inserting - DoEvents after each - .LinkFormat.SourceFullName = StrFlNm and editing the registry, as described in https://www.msofficeforums.com/word-...tml#post130308 if you haven't already done so.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I use as Save As to take the name from a text and change the file path? | rosscortb | Word VBA | 5 | 03-08-2018 04:30 AM |
Change old path to new path (batch) | NobodysPerfect | Word VBA | 2 | 08-14-2014 10:09 PM |
Change path to movie clip? | triumphx1 | PowerPoint | 1 | 12-05-2010 03:55 PM |
Change Action Setting Path | gskelton | PowerPoint | 0 | 02-27-2010 03:20 PM |
How i can change default signature path? | d4rqu | Outlook | 0 | 10-20-2009 02:08 AM |