Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Invoking Mail Merge from Excel

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="""";Us er
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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Invoking Mail Merge from Excel

(John Topley) wrote in message . com...

This appears to have been a temporary aberration as the problem has
"resolved" itself.

-------------------------------------------------------------------------------



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="""";Us er
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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge two excel files like in word mail merge azmerritt Excel Discussion (Misc queries) 1 December 11th 16 09:23 PM
Can anyone tell me how to do a mail merge from Excel? BJS Excel Discussion (Misc queries) 2 March 22nd 10 02:38 PM
How do I do an e-mail mail merge using an Excel spreadsheet? Gretchen Excel Worksheet Functions 0 July 19th 09 05:18 PM
Code launches Mail Merge but disables the Mail Merge austris Excel Discussion (Misc queries) 0 October 14th 06 01:11 AM
mail merge excludes my headers and critical data in Word merge Nix Excel Discussion (Misc queries) 0 April 21st 06 08:35 PM


All times are GMT +1. The time now is 03:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"