![]() |
#1
|
|||
|
|||
![]()
Hello everyone,
When I move various Excel files to different folders, user accounts, computers, etc. they work as long as their related and linked files (other Excel files) are in the same folder area. Can I have the same behavior with my Word file that is connected to other Excel files? I am sorry but I do not know how to express this properly and look up something relevant to it. I currently change the full path on the Word file whenever it is moved to another folder. The folders are Companies, which contain the Word files that are reports which are linked to the Excel files that are the company data (tables, words, charts, etc.). So it is a static condition between the files, but they need to be moved to different areas with different paths - if that makes any sense. Thanks in advance! |
#2
|
||||
|
||||
![]()
Word file links are always absolute. Moving the files to another computer is OK provided that computer has exactly the same folder path to the source files. Given the absolute nature of the links, though, that also means you can move the Word file about without breaking them.
To see how to implement relative paths in Word, check out the field coding and macro solutions I've posted in the Word Fields and Relative Paths to External Files 'Sticky' thread at the top of this forum: https://www.msofficeforums.com/word/...nal-files.html Note: Since links to Excel files employ LINK fields, you'll need the macro solution.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Hello macropod, and thank you for your constant assistance, I will study your post and reply back in case of complete failure.
Thank you again. |
#4
|
|||
|
|||
![]()
Hello again, it has been some time from this post.
The more I try to understand what I have to do to make your macro work the more wrong I am it seems. Is there maybe a step by step guide for super dummies so I can try to make your macro work? |
#5
|
|||
|
|||
![]()
'I think that is the Dummies edition! This is not for the faint-at-heart. Did you download the file at the end?
|
#6
|
||||
|
||||
![]() Quote:
• press Alt-F11 to open the VBE • click on your document's entry in the panel on the left • choose File|Import File • navigate to and select the unzipped file • press OK • save the document. Done. That's essentially the same as what the instructions in the link tell you to do. There really is nothing to simplify.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
Thank you for getting back at this!
Excuse me I did not clarify, I did import your macro and run it, but nothing is happening; the macro runs and nothing changes on any linked item. The files are like this: Word file in: C:\Users\Admin\Documents\Workstation\Audit Modules\Company A\END DATA\Report.docm The Excel files linked on the Word file above are in: C:\Users\Admin\Documents\Workstation\Audit Modules\Company A\Report.xlsm --- The Report.docm needs to be moved below --- C:\Users\Admin\Documents\Workstation\Audit Modules\Company B\END DATA\Report.docm The Excel files linked on the Word file are in (same as before): C:\Users\Admin\Documents\Workstation\Audit Modules\Company B\Report.xlsm So it is a straightforward switch from Company A to Company B, but I guess I am supposed to change something because it is not doing anything as is. |
#8
|
||||
|
||||
![]()
Did you actually move the document to the new location?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
Yes, I did go through multiple tryouts and I am receiving a "Sub or Function not defined" error most of the times, but nothing happens regardless.
|
#10
|
|||
|
|||
![]()
In this context, getting an error message is not "nothing happens."
|
#11
|
|||
|
|||
![]()
Sorry I did not clarify, the error is not something that appears all the time (and did not appear to me up until #9), and regardless of whether it appears or not; "nothing happens" in terms of something happening in the context of the macro functioning.
|
#12
|
||||
|
||||
![]()
That suggests you've not installed the macro the way it is intended to be installed. Perhaps you could attach a copy of the document, with the code as imported, to a post (you can delete the content) You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#13
|
|||
|
|||
![]()
I imported the macro as you described again and I got the same result, a "Module1" with your macro in it.
I linked an item the original file has on a new document and I received this: "Run-time error '6083': Objects in this document contain links to files that cannot be found. The linked information will not be updated." And the following line is highlighted on debug: .SourceFullName = Replace(.SourceFullName, OldPath, NewPath) The linked object can be updated properly and works as expected. |
#14
|
||||
|
||||
![]()
Your document's LINK field is corrupt.
It contains: { LINK Excel.SheetMacroEnabled.12 "C:\\Users\\GMF\\Documents\\Workstation\\Audit Modules\\ΠΡΟΓΡΑΜΜΑ ΕΚΘΕΣΗΣ\\IPPOKRATIS\\ΔΕΔΟΜΕΝΑ ΕΚΘΕΣΗΣ.xlsm!ΣΥΝΟΠΤΙΚΑ!R253C2:R255C12" "" \p } It should contain: { LINK Excel.SheetMacroEnabled.12 "C:\\Users\\GMF\\Documents\\Workstation\\Audit Modules\\ΠΡΟΓΡΑΜΜΑ ΕΚΘΕΣΗΣ\\IPPOKRATIS\\ΔΕΔΟΜΕΝΑ ΕΚΘΕΣΗΣ.xlsm" "ΣΥΝΟΠΤΙΚΑ!R253C2:R255C12" \p } In any event, the file named ΔΕΔΟΜΕΝΑ ΕΚΘΕΣΗΣ.xlsm must be located in the same folder as the document for the update to work.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#15
|
|||
|
|||
![]()
I am not sure why there is an error in the test document in the first place, but I was running the macro while having the documents on 1 folder up from the source files, I did not understand that having the documents in a different folder could be a problem. So I created a new test file and it works properly.
However, I run multiple tests on the original file which has multiple connections (by having it as well on the same folder) and for some reason the macro does not work. Also, there are no errors produced this time (so far). I am not sure how to debug it, any ideas are welcome, but unfortunately I cannot edit the file to the point where I can upload it on the web. I will keep trying and if somehow I figure out the problem I will let you know. |
![]() |
Tags |
keep links, move files |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
John147 | Word | 1 | 08-10-2014 04:18 AM |
Tiny picture/document links | phillip2810 | PowerPoint | 0 | 02-21-2014 02:22 PM |
Embedded Links failing in word document | jim_jim | Word | 0 | 02-05-2013 07:48 AM |
![]() |
Splint | Word | 3 | 11-06-2011 05:50 AM |
![]() |
cosiyak | Word | 1 | 05-22-2011 01:26 PM |