View Single Post
 
Old 03-29-2017, 10:46 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try the attached. I couldn't get your code to work, even after changing the formfield references to content control references, so I've taken an entirely different approach.

Issues with your coding included mismatches in the filename, content control titles and Excel column names, all of which I could correct for. The stumbling-block for me was the Excel column names with spaces etc. in them; I just don't know the SQL syntax well enough to code for that.

As coded the macro in the attached document outputs the data to the next available row in the Excel workbook. Where you have empty rows in the used range (as in your workbook), that means the data will be added after those rows. Deleting any unused rows beforehand will resolve that.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote