Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-08-2023, 06:24 AM
Nana Nana is offline VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes Windows 10 VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes Office 2021
Novice
VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes
 
Join Date: Mar 2023
Posts: 1
Nana is on a distinguished road
Default VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes

Hello!
I have a Word document containing numerous linked Excel tables and charts. This document needs to be copied and modified regularly and its linked Excel tables and charts need to be updated with new data. I am looking for a Macro that, when executed, will:
  • ask to input in a text box text in the LINK field to be found (i.e.: mysheets\\xyz_20230103.xlsx" "Sheet1!);
  • ask to input in another text box text to replace the text found in step 1 (i.e.: yoursheets\\xyz_20230203.xlsx" "Sheet1!);
  • find and replace all occurrences;
  • update all LINK fields and keep their formatting.
For greater precision, the complete Excel object LINK field is { LINK Excel.Sheet.12 "c:\\mysheets\\xyz.xlsx" "Sheet1!L9C3:L33C30" "" \a \p } and needs to be replaced with { LINK Excel.Sheet.12 "c:\\yoursheets\\abc.xlsx" "Sheet2!L9C3:L33C30" "" \a \p }.

I’ve tried ALT-F9 to display LINK field codes, followed by CTRL-H to find and replace then Ctrl-A to select all and F9 to update, but it doesn’t work; the text in the LINK fields changes, but the tables and charts don’t update.

I’ve also found numerous examples of VBA to do one part or another of what I need, but I’m a newbie with VBA and don’t know how to piece them together.

Any help will be greatly appreciated!
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes Word relative link to OLE objects from Excel Marcosnilsson Word VBA 4 01-19-2023 07:59 PM
VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes Replace Embedded Objects with Linked Objects hicksi Word 3 09-29-2021 07:17 PM
VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes How to get the exact same space between specified text boxes or objects croptopmartin Publisher 1 01-27-2016 12:49 PM
VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes Grouping objects (mainly text boxes) taryn Drawing and Graphics 1 10-01-2015 11:06 AM
VBA to find/replace in LINK fields (linked Excel objects) with use of text boxes Can text boxes be linked from one slide to another? John Wade PowerPoint 3 01-18-2012 02:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft