+ Reply to Thread
Results 1 to 3 of 3

Mailmerge to Excel - Stuck once the vba code opens word document

  1. #1
    Registered User
    Join Date
    05-25-2020
    Location
    India
    MS-Off Ver
    2010
    Posts
    1

    Mailmerge to Excel - Stuck once the vba code opens word document

    Hi, I have written mail merge code. however once the word document is open by the code I'm stuck at table option. attaching the image and code for your reference.

    Please Login or Register  to view this content.
    Capture.PNG

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    79,379

    Re: Mailmerge to Excel - Stuck once the vba code opens word document

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new here, I will do it for you this time: https://www.mrexcel.com/board/thread...ument.1199568/)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    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: Mailmerge to Excel - Stuck once the vba code opens word document

    Clearly, you have an error with:
    SQLStatement:=SQL
    whereas what you have declared is not SQL but:
    strSql = "SELECT * FROM 'RawData$'"

    Had you used 'Option Explicit' at the top of your code, both this and all your other undefined variables, would have been trapped.
    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. VBA opens word then keeps trying to open the same document
    By lightning_storm in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 09-11-2016, 10:28 PM
  2. Populate Mailmerge word document from list of excel data
    By sthiru in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-17-2016, 02:33 AM
  3. ActiveCell.Row - Mailmerge to word document - VBA
    By wrightyrx7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-16-2014, 08:44 AM
  4. [SOLVED] Opening Word mailmerge document from Excel using VBA
    By BoldCreature in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2013, 09:09 AM
  5. Mailmerge from Excel and Word to new word document
    By PooH in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 11-12-2011, 05:09 PM
  6. Replies: 3
    Last Post: 03-30-2006, 12:10 PM
  7. [SOLVED] mailmerge to a word document from email addresses in a single cell of an excel sheet
    By junoon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2006, 10:20 AM

Tags for this Thread

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