I have many Excel objects are there embedded in a MS-Word Document.
I want to calculating the grand total: with summing the totals are there in the each specified excel object and return that grand total in the MS-Word document.
Macro holder is MS-Word Document's VBA module.
Means: I need to access to an specified embedded Excel object, form the MS-Word module, then perform it active, then assign to an object-variable by -For example:-
ExcelApplication = GetObject(, "Excel.Application")
statement. Then try to access its appropriated total values , by -For example:-Total = Range("Table1[[#Totals],[Amount]]").Value
. Point is all tables Name are in the Excel objects isTable1
which contains theAmount
Columns and theTotal Row
.
Note is in above Excel objects, The first row which contains the Table Header is Hided.
Example
This document have extending daily.
I need a macro in the
Normal.dotm
Which calculating the grand total of all specified Excel object (specified with assigning a name to them or ...) and perform returning this value withSelection.TypeText Text:=
where is selected in picture below: (at the end of document)
Why I insist to have embedded Excel object?
- Because I have formula for calculating Column1: A, B, C, ....
- Because I have a hided Data base Sheet for data validation Items
- I have Formula in Amount column for multiplying the rates and the amount of each item-unit which is in Data base sheet