Invoking Mail Merge from Excel

J

John Topley

I invoke a mail merge from Excel where my calling Excel workbook
(TestMailMerge.xls) is also the data source for the Mail Merge. When I
close my Excel workbook, I get a message saying my Excel workbook is
available for editing; an instance appears to have been opened as
read-only by the Mail Merge.

My mail merge code is as follows:

ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Documents and Settings\John Topley\My
Documents\TestMailMerge.xls", _
ConfirmConversions:=False, ReadOnly:=False,
LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="",
PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="",
Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User
ID=Admin;Data Source=C:\Documents and Settings\John Topley\My
Documents\TestMailMerge.xls;Mode=Read;Extended
Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet
OLEDB:Registry Path="""";Jet OLEDB:D" _
, SQLStatement:="SELECT * FROM `Year7$`", SQLStatement1:="",
SubType:= _
wdMergeSubTypeAccess

With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
End With
.Execute Pause:=False
End With


My environment is Windows XP and and Excel/Word 2002.

How can I close the Mail Merge instance of "TestMailMerge.xls" (Read
only) and remove the "error" message?

Thanks in advance for your help.
 
J

John Topley

(e-mail address removed) (John Topley) wrote in message
This appears to have been a temporary aberration as the problem has
"resolved" itself.
 

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