Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Closing the Print Dialogue box

Hi:
I would appreciate help with the following:

I have placed code in the Workbook Before Print Event, to alert the
user by displaying a messagebox, if Cell A1 is left blank. The message
states something like this:

"Please enter name in cell A1 before printing this sheet"

Next, I would like to prevent the user from printing the sheet if cell
A1 is blank.

What additional line of code do I need to add so that the "Print
Dialogue" box closes or does not appear at all, thus preventing the
user from printing if cell A1 is left blank?

TIA
Would appreciate your help with the code

Thanks
Vinay

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Closing the Print Dialogue box

Hi Vinay,

Set the Cancel argument of the event procedure to True to cancel
printing.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

wrote in message
ups.com...
Hi:
I would appreciate help with the following:

I have placed code in the Workbook Before Print Event, to alert the
user by displaying a messagebox, if Cell A1 is left blank. The message
states something like this:

"Please enter name in cell A1 before printing this sheet"

Next, I would like to prevent the user from printing the sheet if cell
A1 is blank.

What additional line of code do I need to add so that the "Print
Dialogue" box closes or does not appear at all, thus preventing the
user from printing if cell A1 is left blank?

TIA
Would appreciate your help with the code

Thanks
Vinay



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Closing the Print Dialogue box

Thanks
It worked!
V

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
what is print to file in print dialogue box and its useage? Vandana Excel Worksheet Functions 0 August 23rd 06 11:45 AM
Suppressing print dialogue box sgrech Excel Discussion (Misc queries) 0 September 24th 05 12:14 PM
how can I add a print dialogue? Rob Excel Programming 2 February 5th 05 10:11 PM
Opening and closing a picture dialogue box jontait[_3_] Excel Programming 13 April 28th 04 11:54 AM
Resuming code after closing a print preview DarrenW Excel Programming 1 July 21st 03 02:54 PM


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