+ Reply to Thread
Results 1 to 4 of 4

Excel VBA: Generating Word file [embedded?]

  1. #1
    Registered User
    Join Date
    12-06-2017
    Location
    Hungary
    MS-Off Ver
    2016
    Posts
    43

    Excel VBA: Generating Word file [embedded?]

    Hello!

    I have a complete excel file which runs a lot of macro and VBA. One of the functions is generating a word file from the results. Now its calling a previously made word file, which has all other text and graphics in, and with bookmarks the excel vba is integrate the datas and tables in it, and save it as another word file in the same directory where the excel is.

    Now the problem is;

    This excel file is used by many people and not everyone has proper access to the starting word file (which is now on a NAS). Because of this, creating a new word file has problems from time to time.
    I thought excel could, embed and store the original word file, but I didn't find a solution how I could access and use bookmarks in vba in the same way as before.
    The second variation that came to my mind is that there would be no starting word file at all, all the data would be generated from the excel but in this case the problem is how I put the company header and logos in the generated word file?

    So the end result should be one excel file which works the same as before and would not call the the WORD file from the NAS.

    Do you have any ideas for this, which solution would be a good way to do this?

  2. #2
    Registered User
    Join Date
    12-06-2017
    Location
    Hungary
    MS-Off Ver
    2016
    Posts
    43

    Re: Excel VBA: Generating Word file [embedded?]

    OKay Im trying to figure it out. This code does the trick with some flaws.

    Please Login or Register  to view this content.
    Obejktum 2 is the embedded word file.

    The problem is, that this code overwrite the embedded word and not making a new one. So if I change something and generate the word again it will be a total mess of the previous and with the new data.

    Any ideas? How to make that the embedded word remain just the CORE and INTACT?

    Thanks

  3. #3
    Registered User
    Join Date
    12-06-2017
    Location
    Hungary
    MS-Off Ver
    2016
    Posts
    43

    Re: Excel VBA: Generating Word file [embedded?]

    No one?

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Excel VBA: Generating Word file [embedded?]

    The simplest solution would be to store a Word template in a folder all users are given access to. What you haven't explained, though is how users can get access to the Excel workbook, but not the Word file. If you're achieving access by distributing the Excel workbook, why are you not distributing the Word document with it?

    Alternatively, you could have your code save the embedded Word file to whatever folder the Excel workbook is stored in, then access it (not the embedded version) in the normal manner.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ 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. Using data from Excel file that's embedded in Word
    By holdemfoldem081 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2018, 12:08 PM
  2. Trying to replicate a mail merge on an embedded Word file
    By CodingNoob in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2017, 06:59 PM
  3. Open embedded excel file (in a word document) using VBA from excel workbook
    By ChrisHook in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-31-2016, 01:31 PM
  4. Word embedded Excel file to open automatically
    By Dunctonsteel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2013, 03:16 PM
  5. Executing a Mail Merge with An Embedded Word File
    By GazB in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-15-2013, 07:06 AM
  6. Embedded Excel file in Word
    By QOAT in forum Excel General
    Replies: 1
    Last Post: 03-31-2006, 01:10 PM
  7. Replies: 0
    Last Post: 08-03-2005, 04:05 PM

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