Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "is now available for editing" problem with Excel-automated mail merge

I have an excel file template that automated to open from an Access
application that will 1) save the template as a new file with the
current date/time appended to the file name, 2) pull data from an
Access database and format the data into a usable mail merge file, and
3) open the mail merge file in Word. This all works well only I have
two problems with which I need some help.

The first problem is how can I automate the mail merge file to open
with the current Excel file as the datasource for the mail merge?
Right now, I'm cutting and pasting the file path into Word myself.

The second problem is that once the mail merge is done, I close the
Word file and the Excel file. Then I get a message that the Excel
file I just closed file "is now available for editing. Choose Read-
Write to open it for editing." What can I do to prevent this?

Here's the code that currently opens the Word document:

Sub Create_Emails()

Dim appWD As Object
Dim stPath As String

ActiveWorkbook.Save

stPath = "X:\ProdMgt\RRAdmin\Request Processing\Entitlement and
Increased Access Requests\Templates\Request Denied (EIA) TEMPLATE.doc"
Set appWD = CreateObject("Word.Application")
appWD.Visible = True
appWD.Documents.Open (stPath)
appWD.ActiveDocument.MailMerge.MainDocumentType = wdEMail
Set appWD = Nothing

End Sub

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
"Locked for Editing" problem in Excel 2007 Adam Excel Discussion (Misc queries) 1 August 22nd 07 03:29 AM
How Might I "Mail Merge" Data For Multiple .txt File Output? [email protected] Excel Programming 2 January 8th 07 05:44 AM
Change the "Insert Function" display for mail merge Beach Lover Excel Worksheet Functions 3 November 1st 06 06:41 PM
Mail Merge drops 1st digit ("0") converting from Excel to Word Chuck Martini Excel Discussion (Misc queries) 3 August 7th 06 10:34 PM
Finding multiple values in excel, then sending as "mail merge" Tom Excel Programming 2 June 10th 04 08:53 PM


All times are GMT +1. The time now is 09:47 AM.

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

About Us

"It's about Microsoft Excel"