LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel code to Wait until Word finishes printing before closing

I'm using Excel 2000 & windows nt 4, sp6.

I'm using Excel to extract label info to a 'prn' file,
then opening a Word doc & merging 'prn' info, then
printing the merged document.

Works great - except that when I attempt to close the word
object, I get a message that Word is printing & closing
will stop the printing. Don't want that to happen, but I
also want to close Word from within Excel.

My question is: Is there a way to execute a loop to
determine when the print job has finished? Where do I put
the loop? Or this a needless worry?

Thanks - mike

Code:

Dim wordApp As Object
Set wordApp = CreateObject("Word.Application")

With wordApp
.Documents.Open Filename:="1.doc", _

(formatting code)

.Application.PrintOut Filename:="1.doc", _

.activeDocument.Close

End With

wordApp.Quit

 
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
sendkeys(keys,wait) how do I use wait MM Excel Discussion (Misc queries) 1 February 11th 09 03:47 PM
Re-show userform after closing file - code help Gerry O Excel Discussion (Misc queries) 3 September 4th 07 10:52 PM
How to code on Macro on saving and closing a file? Eric Excel Worksheet Functions 1 June 10th 07 01:32 PM
Resume.xlw and closing workbook with VBA code. BruceS Excel Discussion (Misc queries) 6 November 4th 06 08:19 PM
Closing the VBA Editor using code Bony_Pony Excel Worksheet Functions 1 March 7th 05 08:14 PM


All times are GMT +1. The time now is 02:12 AM.

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"