![]() |
|
#2
|
|||
|
|||
|
The first mistake you have made is using Late Binding.
There is no value to using late binding in this instance. The only advantage to late binding is version independence, i.e. you can write code in a newer version and it will theoretically work in an older one. But that advantage is lost unless you also use late binding for the host application code as Office is usually installed as a package. It is better to use early binding when working with other Office applications and reserve late binding for other commonly used libraries, e.g. ADO or XML. By adding a reference to the Excel library (Tools | References) and declaring the object variables with their correct types (eg. Dim chartObj As xl.Chart) you get the benefit of IntelliSense. Instead of Code:
chartObj.Copy Code:
chartObj.ChartArea.Copy Code:
bmRange.InlineShapes(1).Chart.ChartData.Activate bmRange.InlineShapes(1).Chart.ChartData.BreakLink |
| Tags |
| charts, copy, update |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Is there a way to stop macro modifications from undoing when Updating Word Linked Tables?
|
soroush.kalantari | Word VBA | 3 | 06-27-2021 06:15 PM |
| Problem With Updating Linked Excel Tables in Word 2013 | maverick1714 | Word | 6 | 09-30-2014 12:30 AM |
Word 2013 Fields not updating
|
awaywithpixie | Word | 1 | 09-10-2013 10:35 AM |
| Updating lists of figures/Tables in a protected document | IHARKIS | Word | 0 | 03-02-2011 04:39 AM |
| Auto-updating basic math functions & cross-referencing tables | FranklinBluth | Word Tables | 13 | 11-19-2009 10:26 AM |