Using VBA to update range of Word table linked to an Excel file

CDMART

New Member
Joined
Sep 12, 2013
Messages
1
Hello,

I am working with a Word file that has tables linked to different ranges in Excel. Since the size of the table can change in Excel, I am looking for a way to update the ranges of all the linked tables in Word in an automated fashion instead of manually having to update them.

To clarify what I am referring to, the manual process for updating the linked table range is:
1) Open the "Links" window (clicking through "File->Info->Edit Links to Files" is one method)
2) Select a link that is to an Excel file (my "Type" is Excel.Sheet.8) and click "Change Source..."
3) Click on "Item..."
4) Select the Excel file that should be used (which is staying the same in my case)
5) Update the R1C1 style reference to the range in Excel to be used (ex. Sheet1!R1C1:R4C5 -> Sheet1!R1C1:R6C6)

My plan is to use VBA, but I do not know what objects are required to access and update the value changed in step 5 above. Can anyone please share VBA code to do this? I looked for example online with no luck and even tried the old trick of recording a macro which recorded nothing as predicted in this case.

FYI - Because of everything else that is going on in the Word document I am using, simply the deleting existing tables and then recreating them using links to the new range is not really a viable option.

Thank you very much,

Chris
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,215,521
Messages
6,125,308
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top