+ Reply to Thread
Results 1 to 5 of 5

Copying embedded word object into many different workbooks

  1. #1
    Registered User
    Join Date
    11-12-2013
    Location
    Chaska, MN
    MS-Off Ver
    Excel 2010
    Posts
    24

    Copying embedded word object into many different workbooks

    Hello,

    I need to add a header onto around 1200 documents that are to be reviewed. The header is an embedded word object that has to be there so it’s the same size and stuff as the rest of the office documents that are printed. Its near trivial to add by copy and pasting by hand but is time consuming for a lot of documents.
    Below is the code I have so far. This code is to:
    1. Copy the header off the sheet 1 page
    2. Ask for a directory
    3. Find all the excel documents in that directory
    4. Open the first workbook
    5. Find first active sheet
    6. Add 8 lines to the top of the file
    7. Paste the header
    8. Repeat for all active sheets
    9. Save and close the workbook
    10. Open the next workbook.



    Please Login or Register  to view this content.
    So I have no idea how else I should try this. Any suggestions?
    Thank you,

  2. #2
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Copying embedded word object into many different workbooks

    Can you attach a sample workbook containing the object you're trying to copy?
    Acts 4:12
    Salvation is found in no one else, for there is no other name under heaven given to mankind by which we must be saved.

  3. #3
    Registered User
    Join Date
    11-12-2013
    Location
    Chaska, MN
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying embedded word object into many different workbooks

    Hello,

    I have attached an example. I have just been hitting F5 to run it in the vba editor.

  4. #4
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Copying embedded word object into many different workbooks

    Give this I try. I moved your variable defs outside the subroutine to expand the scope, which makes passing ws as a parameter unnecessary, and I tweaked a few other things. I would also be careful about using DisplayAlerts=False and EnableEvents=False unless you have specific reasons for needing them.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-12-2013
    Location
    Chaska, MN
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: Copying embedded word object into many different workbooks

    Hello,

    Awesome, that works perfectly. Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Help with VBA Excel Range to Embedded Word Object
    By cuchulainem in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2013, 04:53 PM
  2. Working with an embedded Word object?
    By Charles M in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-07-2008, 01:34 PM
  3. [SOLVED] Reference to an Embedded Word Object
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-20-2006, 10:10 AM
  4. [SOLVED] Cannor strech embedded word object
    By BartDesc in forum Excel General
    Replies: 2
    Last Post: 03-10-2006, 04:20 AM
  5. [SOLVED] should be possible to view entire MS Word embedded object in MS E.
    By Phillip M. Feldman in forum Excel General
    Replies: 1
    Last Post: 04-21-2005, 09:06 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1