VBA mailmerge from Excel

D

Dave Baxandall

I have a problem starting Mailmerge from Excel. I've
created a macro in word that runs the mailmerge without
any problems. When I start word from Excel (which is also
the data source) I get a pop-up telling me that the excel
file is already open. I then need to choose read-only,
notify or cancel. This pop-up can take up to 60 seconds to
display. In the mean time the excel macro returns a error
message - 440 Method 'Run' of object '_Application' failed.

In debug the word code that takes a long time is.

Sub z_create_mail_merge(source As String)
'
' z_create_mail_merge Macro
' Macro recorded 2003/10/14 by TELUS
'
' Connection:="merge_it" is the range on the spreadsheet

ActiveDocument.MailMerge.MainDocumentType =
wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
source, _
ConfirmConversions:=False, ReadOnly:=True,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="",
WritePasswordTemplate:="", Revert:=True, _
Format:=wdOpenFormatAuto, Connection:="merge_it",
SQLStatement:="", _
SQLStatement1:=""
....

Thanks in advance
Dave Baxandall
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top