Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Pause Printing in VBA

:) Hello!!

I have written a Macro in VBA to print Invoices with data
from an Excel Worksheet. But I have about 250 Bills to print. Could someone
tell me how I can include a few more lines of code in my Macro that will
enable pauses in the printing, at a keystroke ?!

I would very much appreciate a solution that is not very
difficult !!

Thank You !!


Vijay
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Pause Printing in VBA


I doubt if there is a way to do that.
Maybe you should only print 25 to 50 bills at a time.
Helpful newsgroup posting tips here... http://www.cpearson.com/excel/newposte.htm

--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Vijay Chary"
wrote in message
:) Hello!!
I have written a Macro in VBA to print Invoices with data
from an Excel Worksheet. But I have about 250 Bills to print. Could someone
tell me how I can include a few more lines of code in my Macro that will
enable pauses in the printing, at a keystroke ?!
I would very much appreciate a solution that is not very difficult !!

Thank You !!
Vijay
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Pause Printing in VBA

On Mar 29, 4:37 pm, "Jim Cone" wrote:
I doubt if there is a way to do that.
Maybe you should only print 25 to 50 bills at a time.
Helpful newsgroup posting tips here...http://www.cpearson.com/excel/newposte.htm

--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

"Vijay Chary"
wrote in message
:) Hello!!
I have written a Macro in VBA to print Invoices with data
from an Excel Worksheet. But I have about 250 Bills to print. Could someone
tell me how I can include a few more lines of code in my Macro that will
enable pauses in the printing, at a keystroke ?!
I would very much appreciate a solution that is not very difficult !!

Thank You !!
Vijay


Hello Vijay,

This macro may help you. You need to be running Excel 2002 or above.

Macro Code
================================================== ====================================
'Written: March 30, 2008
'Author: Leith Ross
'Summary: Pause a local printer by name
'Note: Windows 2000 and Windows NT 4.0 - This method is not available.

Sub PausePrinter(ByVal Printer_Name As String)

strComputer = "."
Printer_Name = Printer_Name & " on ADMINS" '&
Environ("ComputerName")

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colPrintJobs = objWMIService.ExecQuery("Select * from
Win32_Printer")

For Each objPrintJob In colPrintJobs
'objPrintJob.Pause - Change this to objPrintJob.Resume to
comntinue
If Printer_Name = objPrintJob.Name Then objPrintJob.Pause
Next objPrintJob

End Sub
================================================== =====================================
Sincerely,
Leith Ross
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
Pause between copies of Excel sheets while printing waybomb Excel Discussion (Misc queries) 1 August 8th 08 04:50 PM
pause macro to make changes before printing. Baffee Excel Programming 4 May 30th 06 02:18 PM
Best way to pause? Ramthebuffs[_26_] Excel Programming 2 March 1st 06 03:48 AM
Pause cogent Excel Programming 3 June 2nd 04 05:54 AM
Pause? Pete Fedrowitz Excel Programming 2 February 13th 04 06:05 PM


All times are GMT +1. The time now is 06:01 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"