Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
"Locked for Editing" problem in Excel 2007 | Excel Discussion (Misc queries) | |||
How Might I "Mail Merge" Data For Multiple .txt File Output? | Excel Programming | |||
Change the "Insert Function" display for mail merge | Excel Worksheet Functions | |||
Mail Merge drops 1st digit ("0") converting from Excel to Word | Excel Discussion (Misc queries) | |||
Finding multiple values in excel, then sending as "mail merge" | Excel Programming |