Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Disable print function on current workbook

I need to be able to disable the print function for the current workbook
only, but I still want the print macro that I wrote to work. If the print
function is used without using the print macro, it'll print out 100 pages.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Disable print function on current workbook

Hi AvalancheMike

You can use this event in the thisworkbook module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
End Sub

Then in you macro use EnableEvents

Sub test()
Application.EnableEvents = False
ActiveSheet.PrintOut
Application.EnableEvents = True
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl



"AvalancheMike" wrote in message
...
I need to be able to disable the print function for the current workbook
only, but I still want the print macro that I wrote to work. If the print
function is used without using the print macro, it'll print out 100 pages.

Thanks!



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
Disable print option of a worksheet/workbook Nelly07 Excel Discussion (Misc queries) 0 October 23rd 07 10:19 PM
Can you disable the save function from a shared workbook jcallahan Excel Discussion (Misc queries) 2 April 3rd 07 02:11 AM
How can I print current row in same place on paper but not print surrounding cells??? Andy Ford New Users to Excel 1 September 2nd 05 05:50 AM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM
Disable Print Button In a Single Workbook Hambone Excel Programming 0 January 31st 04 12:31 AM


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