Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is a great lag in opening these documents. Read the
information below. This is opening another spreadsheet and closing the current one that will allow me to run the 2nd macro. Sub Rectangle1_Click() Workbooks.Open ("H:\Created Projects\Excel\xxxxx\To get doc open.xls") Workbooks("xxxxx.xls").Activate ActiveWorkbook.Close (Yes) End Sub This is where it's taking a long time to open the word doc. (that's merged) and the excel spreadsheet with the merged data. Sub Open_RetentionDoc() Dim appWD As Object Dim wdDoc As Document Set appWD = CreateObject("Word.Application") appWD.Visible = True appWD.ChangeFileOpenDirectory ActiveWorkbook.Path appWD.Documents.Open Filename:="H:\Created Projects\Word\xxxxx\xxxxx Project\letters\xxxxx Letter.doc" Set wdDoc = appWD.ActiveDocument ActiveWorkbook.Close (No) End Sub This is the macro that sends the merged information to a new document and closes the mail merged doc. How can I keep the excel spreadsheet open at this point? When I have the merged doc. to close it automatically closes the spreadsheet, too. docname = ActiveDocument.MailMerge.DataSource.DataFields ("Name").Value x = ActiveDocument.MailMerge.DataSource.DataFields ("Records").Value With ActiveDocument.MailMerge .Destination = wdSendToNewDocument .SuppressBlankLines = True With .DataSource .FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord .LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord End With .Execute Pause:=False End With Documents("xxxxx Letter.doc").Close (Yes) ActiveDocument.Close (Yes) Application.Quit End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem opening up current Excel wksht to mail merge in Word | Excel Discussion (Misc queries) | |||
Unable to open Excel file/Mail Merge | Excel Discussion (Misc queries) | |||
When I open an excel workbook to mail merge nothing is shown | Excel Worksheet Functions | |||
Mail merge with header/field info in 3rd row | Excel Discussion (Misc queries) | |||
Mail merge (Word97) only importing 1st 85 rows of info from Excel | Excel Discussion (Misc queries) |