Jan 24 2018
03:25 AM
- last edited on
Jul 25 2018
09:48 AM
by
TechCommunityAP
Jan 24 2018
03:25 AM
- last edited on
Jul 25 2018
09:48 AM
by
TechCommunityAP
Hi,
I am after your advice on how to open a mail merge Word doc with data in an Excel spread sheet...
I have an Excel spread sheet that I run a macro in to tidy up the data, before then using the data for a Word mail merge. At the end of my Excel macro I want to open the Word document. I have the code below which opens the Word document however it breacks the mail merge link when I use this code.
If I open the Word document manual I get a prompt saying "opening this document will run the following SQL command..." (see pic below). If I click on yes my mail merge works correctly. I am guessing that when I open the Word doc (with the macro) that "No" is being selected.
Thanks in advance for your help
Sub OpenWord()
Set wordapp = CreateObject("word.Application")
ChDir "C:\A1 Labels"
Workbooks.Open Filename:="C:\A1 Labels\Labels DATA.xlsx"
End Sub
Jan 26 2018 10:12 AM