Results 1 to 9 of 9

Thread: bookmarks (97)

  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    bookmarks (97)

    Is it possible to place bookmarks (or other markers) in embedded Excel cells in a Word document to be filled in by a VBA userform run from a Word template? Thank you.

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: bookmarks (97)

    Could you expand on your scenario?

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: bookmarks (97)

    I have a Word .dot file that is a report to client filled in partly via a user dialog built in VBA. The Word .dot has in it embedded a block of Excel cells with formulas calculating subtotals and totals (it is a mini-budget). I would like to be able to fill in the Excel cells that will be calculated from the Word VBA user dialog box (using Excel's version of bookmarks?). I am a newbie to Excel and Excel VBA, experienced in Word templates and Word VBA. Thank you.

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: bookmarks (97)

    I think what you are looking for is to address specific cells using

    workbook("embeddedwbname").worksheet("sheetname"). range("celladdress").value = mydialogboxvalue

    but using it in your situation of an embedded workbook object is way beyond my skills.
    -John ... I float in liquid gardens
    UTC -7ąDS

  5. #5
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: bookmarks (97)

    Excel's version of bookmarks?

    In Excel, they are called ranges. Found under the Insert, Name menu.

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Edit Excel Workbook Embedded in Word document

    This is a very interesting problem. I am attaching a sample Word 2000 document with an embedded Excel 2000 workbook and code that multiple two cells by two and then returns to the document.

    The strategy used in the VBA procedure is as follows:

    (1) Identify the first InlineShape object that is an Excel.Sheet... object
    (2) Activate the InlineShape (I think this activates Excel, but I'm not 100% sure)
    (3) Set an object reference to the InlineShape's OLEFormat.Object property as an Excel Workbook
    (4) Manipulate the cells using Excel methods
    (5) Return to the Word document

    The method I use to return to the document is "not elegant" to say the least. I tried many things and was frustrated at every turn. Nothing useful popped up in searches at MS. I would love to learn of a reliable alternative to using SendKeys.

    Comments?
    Attached Files Attached Files

  7. #7
    Star Lounger
    Join Date
    Jan 2001
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Edit Excel Workbook Embedded in Word document

    Wow, thank you all for your great ideas. I'm amazed at the helpfulness of this place. This is a bit more than I have time to address, given my unfamiliarity with Excel, but I will get back to it and dive in. Thanks again so much for the tips.

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Edit Excel Workbook Embedded in Word document

    Hi,
    Just as an alternative - you might want to actually create a separate Excel workbook and link that into your document. The code for manipulating it would be much simpler then! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  9. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Edit Excel Workbook Embedded in Word document

    Alternatively, since it's a "simple budget" could you build it as a Word table with all the necessary Word math functions, and then copy the resulting complete table to an Excel WB?
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

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