Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Open a mail merge from excel: common problem

Office 2003:

I've seen similar postings a couple times without a good solution. I
have an excel macro that flags the active row by puting the value "1"
in column 101. It then launches a filtered (DDE) word mailmerge
document that omits all data except the row with "1" in column 101.
This allows me to create a new word document based on the data of the
selected row.

code:

Sub MakeReferral()

' MakeReferral Macro

'save row number in holdrow variable
holdrow = Selection.Row
'put "1" in column 101 of active row
Cells(holdrow, 101).Value = 1

'Launch Word and make it visible
Set WordObj = CreateObject("Word.Application")
WordObj.Documents.Open ("P:\aftercare\Aftercare Referral Filtered.doc")
WordObj.Visible = True
Set WordObj = Nothing

'Clean up
Cells(holdrow, 101).Value = ""
End Sub

Here's the problem: It hourglasses me for a good 30 seconds, and then
prompts me "list.xls is locked for editing", and I have to open a
duplicate read-only version of the spreadsheet. It merges the one
filtered row, and then I close the duplicate spreadsheet.

While this does what it's supposed to, it wastes more time than it
saves. If I repeat the process manually, It works instantaneously
without any prompts or duplicate databases. I've seen a solution that
closes the .xls document in the process, but I don't want to do that.

Any ideas?

--jabberwocky

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
Unable to open Excel file/Mail Merge Marie Excel Discussion (Misc queries) 2 October 16th 09 06:37 PM
When I open an excel workbook to mail merge nothing is shown vanessa Excel Worksheet Functions 0 September 7th 07 05:32 AM
How to open Excel list in Word for mail merge/labels? Leinani Excel Discussion (Misc queries) 2 March 28th 07 01:58 AM
Excel macro to open word mail merge Chad Excel Programming 0 May 30th 04 01:06 AM
Excel/Word Mail Merge Problem AA[_2_] Excel Programming 0 September 19th 03 03:53 PM


All times are GMT +1. The time now is 02:43 PM.

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"