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: 34
Default Get Control Before AND After Printing

Thanks for your reply.

I see what you're saying. I tried .PrintOut with the command button
approach, but not with the BeforePrint approach. But, won't I still NOT get
the print options dialog when I use .PrintOut with BeforePrint?

I guess my question was poorly stated, in that I want BOTH -- the
shading/unshading, AND the print options dialog.

Do you know any way I can get both?

Thanks,

Phil
"Jim Thomlinson" wrote:

The whole thing is done with the before print. the general flow is to cancel
the print job, do your shading, disable the events print the document and
re-enable the events...

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Cancel = True
Application.EnableEvents = False
'do your shading
ThisWorkbook.PrintOut
'undo your shading
Application.EnableEvents = True
End Sub
--
HTH...

Jim Thomlinson


"pwrichcreek" wrote:

I want to get control before printing, change the shading on certain cells so
that the shading does not show up on the printed page, and then get control
again after printing and change the shading back to what it was before
printing. The WorkbookBeforePrint event works fine and I get the desired
printing. But I don't know how to get control to change the shading back.

Is there some other event I can intercept that will let me make the
formatting change after printing?

If I use the .PrintOut method on a commnd button, I get control both before
and after printing. However, I lose the printer setup dialog (destination
printer, number of copies, etc.) that comes "for free" with the File/Print
command.

Is there something I can do to get the printer setup dialog to come up when
using .PrintOut?

TIA,

Phil

 
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
2007 Form Control/ActiveX Control font difference Nikko963 Excel Discussion (Misc queries) 0 April 15th 09 04:21 PM
Control ToolBox OptionButtons Printing? Ken Excel Discussion (Misc queries) 3 May 23rd 07 12:47 PM
Printing the contents of a text control on a user form Chaplain Doug Excel Programming 3 May 24th 06 08:32 PM
My spreadsheet has a control box. box moves after printing. Why? BellExcel Excel Discussion (Misc queries) 2 May 21st 05 12:23 AM
Error "Permission denied" when printing Web Browser control from button on userform, Charles Jordan Excel Programming 0 July 8th 04 04:19 PM


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