LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
JRB JRB is offline
external usenet poster
 
Posts: 10
Default Erm ... Just one more thing please

Everything seems to work extremely well ... except that I would like to keep
the Word application hidden.
I have inserted :
WD.Application.ScreenUpdating = False
WD.Application.Visible = False
prior to the line which opens the document (see below)
But after the printer dialog box is closed the Word application pops up
during the printing process
I would like to prevent this happening ... Have you any suggestions

........................
Dim WD As Object
Set WD = CreateObject("Word.Application")
WD.Application.DisplayAlerts = wdAlertsNone

WD.Application.ScreenUpdating = False ' ......... This is
probably superfluous
WD.Application.Visible = False

WD.Documents.Open (ThisWorkbook.Path & "\PrivList Labels.doc")
If WD.ActiveDocument.MailMerge.State < wdMainAndDataSource Then
WD.ActiveDocument.MailMerge.OpenDataSource _
Name:=ThisWorkbook.Path & "\PrivList.csv", _
LinkToSource:=True
End If
WD.ActiveDocument.MailMerge.Destination = wdSendToPrinter
WD.ActiveDocument.MailMerge.Execute
WD.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
WD.Application.DisplayAlerts = wdAlertsAll
WD.Quit SaveChanges:=wdDoNotSaveChanges
Set WD = Nothing
...........................................


 
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
automation code deepika :excel help[_2_] Excel Discussion (Misc queries) 0 February 18th 08 01:48 PM
Automation Error, Unknown Error. Error value - 440 Neo[_2_] Excel Programming 0 May 29th 04 05:26 AM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM
Need HELP to modify code (need more automation) Paul B[_6_] Excel Programming 6 July 12th 03 10:08 AM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 10:48 PM.

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"