Thread: [Solved] Updating tables in Word
View Single Post
 
Old 04-14-2025, 12:32 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by BigMac'ro View Post
That would be possible if the Excel workbooks wouldn't change. In my case, the report gets regularly updated and so do the Excel files. The old Excel files are kept. For the report in January 2024, I have to refer to excel files called e.g. "202401_Data1.xlsx", "202401_Data2.xlsx",... One month later, it would be "202402_Data1.xlsx", "202402_Data2.xlsx",... That's why I came up with the "reference file" listing all paths to the relevant workbooks. Plus, there are several people working on the report, sometimes with somewhat inconsistent file-naming approaches I think it will be more easy to convince them to keep the reference file up to date than changing their file-naming habits...
So use VBA code to change the link filenames. Trivial compared to what you're trying to do now. Even with inconsistent filenaming, all you need is a dialog box for selecting the source file. This can all be done from within Word and, depending on what you want to do can be done via DATABASE fields or possibly ADODB - the latter without even opening the workbook. Think about it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote