+ Reply to Thread
Results 1 to 8 of 8

how to connect Word with Excel (VBA)

  1. #1
    Registered User
    Join Date
    11-06-2018
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    95

    how to connect Word with Excel (VBA)

    hi guys,

    i would like to copy data from Microsoft Word and paste it into excel file and do it 140 times.

    The only thing which i need and i cannot solve it is how to connect those two applications? When i was recording macro in Word i couldnt get line with changing window to Excel

  2. #2
    Registered User
    Join Date
    11-06-2018
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    95

    loop macro does not work

    hi guys,

    Code below (in Microsoft Word) is not working for me, do you know why?

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor Parth007's Avatar
    Join Date
    12-01-2014
    Location
    Banglore
    MS-Off Ver
    2010
    Posts
    879

    Re: how to connect Word with Excel (VBA)

    Please Login or Register  to view this content.

    Add the reference of Microsoft Word in your Excel Workbook & change the file path
    Regards
    Parth

    I appreciate your feedback. Hit * if u Like.
    Rules - http://www.excelforum.com/forum-rule...rum-rules.html

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: how to connect Word with Excel (VBA)

    Do you mean you want to copy data from 140 Word documents into 1 Excel workbook?

    Or you want to copy data from 140 Word documents into 140 Excel Workbooks?

    Or data from 1 Word document into 140 Excel workbooks?

    Or 140 bits of data from 1 Word document into 1 Excel workbook?

    Or something else?

    Make your requirement clearer. Include sample documents, and any code you've already tried. Help us to help you.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  5. #5
    Registered User
    Join Date
    11-06-2018
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    95

    Re: how to connect Word with Excel (VBA)

    Do you mean you want to copy data from 140 Word documents into 1 Excel workbook?
    yes

    Or you want to copy data from 140 Word documents into 140 Excel Workbooks?
    This

    However, i was thinking about doing everything macro in Word only, so it would copy from 1st file then paste it to another Word File (lets say the one called Database), and then close this file and open 2nd file and do the same for every file in the folder.

    So i did macro, but i am struggling now with loop, any loop that i found in internet was not working, i mean at all...

    Could you please assist me with that?

    Moderator has merged threads, so link to other thread has been deleted
    Last edited by 6StringJazzer; 07-17-2019 at 09:29 AM.

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: how to connect Word with Excel (VBA)

    Why have you started a second thread?

    Attach sample Word document(s) containing the information you want to transfer, and a sample Excel workbook, showing how you want to import the data.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: how to connect Word with Excel (VBA)

    zarize92, I merged this thread with the other one you started just to show some code. Your code now appears as post #2. Do not start a new thread for the same question.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  8. #8
    Registered User
    Join Date
    11-06-2018
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    95

    Re: how to connect Word with Excel (VBA)

    The problem is solved...

    "\" was missing in the directory path at the end of this path...

    simple as that :P


    vDirectory = "C:\Users\Desktop\QWERTY"

    Should be

    vDirectory = "C:\Users\Desktop\QWERTY\"

+ 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. Excel VBA - Word to search for part of a word and replace full word
    By charlie543 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-24-2016, 02:56 AM
  2. How to connect CRM to Excel VBA?
    By Monica85 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2013, 01:34 AM
  3. How to connect word and excel document
    By L_ter in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2009, 03:11 AM
  4. Connect excel cells to word
    By Olod in forum Excel General
    Replies: 2
    Last Post: 03-01-2007, 09:46 AM
  5. How can I connect a word of text to a certain dollar value?
    By caracasven in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-12-2006, 01:20 PM
  6. Excel cannot connect to web
    By Ltat42a in forum Excel General
    Replies: 0
    Last Post: 05-29-2006, 12:18 PM
  7. [SOLVED] From excel connect to SQl
    By Alvin Hansen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-28-2005, 09:05 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