View Single Post
 
Old 04-15-2019, 05:38 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,143
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I didn't touch your chart. It is exactly as it was in your original. I only showed how to write to your Excel table that serves the chart and also to the table in the document.

You can insert a button using the activeX button option on the Developer tab and apply the code to that button. However given your comments about the button printing, a ribbon button would be preferable see attached and also see http://gregmaxey.mvps.org/word_tip_p...bbon_main.html

You can put the new table anywhere you want by setting a range to that location In the example it simply puts it at the end.

If you move the tables around then they no longer have the same IDs. oTable in question is the copy of Table 2 added to the range oRng. If Table 2 is no longer the correct table e.g. because you have moded table 1, then the code will not work without changing the table IDs as appropriate.
Attached Files
File Type: docm Test Excel embedded chart.docm (59.9 KB, 11 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote