Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Embed XL worksheet into Word (XL & Word 2002)

    Once again, I find myself a little over my head...

    I have a worksheet that I need to embed into a word document in an automated process, creating a compound document. This document is actually a template for a report that will be customized for several customers weekly. Easy enough, except that there will be times when the embedded worksheet will be longer than the available page space. Does anyone have any code that would conditionally and flexibly split an embedded worksheet between two pages in Word?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Embed XL worksheet into Word (XL & Word 2002)

    What do you want to do if the workbook object is too large:

    Shrink the size in word in to fit the page?

    Split the workbook object into 2 or more (as appropriate) "Areas" and embed multiple workbook objects?

    If multiple objects are to be embedded, how do you want to split them: evenly among the pages, fill up 1 sheet then put the the remaining portions onto the number of required sheets?

    Some other method?

    Not sure if this is the best way, but I could see taking the range from excel and adding it as an object in word, checking the size of the shape in word, then either adjusting to the width or ht of the activepage, or if multiple objects are desired, taking parts of the range until the correct sizes are obtained.

    I envision trial and error (by VB) to determine the sizes required (perhaps there are some techniques and objects I am unaware of for checking more systematically: I am not that familiar with words object model)

    Steve

  3. #3
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Embed XL worksheet into Word (XL & Word 2002)

    As usual, I didn't give enough information. Whenever I do give a lot of information, I feel like I'm rambling...

    The decision I came to is that I need to split the data into multiple objects. So I'm working on that now. Thanks for the input.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •