View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Linking Embedded Sheets

The easiest solution is to Link the files rather than Embed them, then you
can maintain their formulae to eachother.
Once embedded they lose the notion of a "file" and exist as a separate
entity.

In theory you could use Excel/VBA code to return the document they are in,
with:
Dim Cont as Object
Set Cont=ThisWorkbook.Container
but I can never get this to work from Excel in Word, although word in Excel
functions as expected.

Also the Word/VBA help is not much better.
<From Help
Container Property Example
This example displays the name of the container application for the first
shape in the active document. For the example to work, this shape must be an
OLE object.
Msgbox ActiveDocument.Shapes(1).OLEFormat.Object.Containe r.Name
</From Help
This always fails also.

NickHK

"Pachydermitis" wrote in message
oups.com...
Hi,
I need to embed several worksheets into a word document. My problem is
that the sheets need to be linked to each other. Can anyone point me
in the right direction. I've done my fair share of vba in excel and
have done a lot of expert level vba programming in other office apps so
if this requires vb that would be great too.
Thanks for your time and ideas.
Pachydermitis