Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to Determine PrintJob is Finished with VBA

I would like to change the format on certain cells on a worksheet when a
user prints the worksheet. Then, after the print is complete, I would like
to restore the formatting back to its original state. I can add code to the
BeforePrint event to change the format, but am having problems restoring the
format as there is no AfterPrint event.

Does anyone have an idea or tip to use for cases like this.

Thank you in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to Determine PrintJob is Finished with VBA

In beforeprint

make you changes
disable events
issue a command to print
enable evens
change back
' now cancel the original print command
cancel = true
End beforeprint event.

The disadvantage is there is no easy way to differentiate a print preview
from a print command, and both fire the beforeprint event - so you would
force a print when the user only wants a print preview

--
Regards,
Tom Ogilvy

"SFatz" wrote in message
...
I would like to change the format on certain cells on a worksheet when a
user prints the worksheet. Then, after the print is complete, I would

like
to restore the formatting back to its original state. I can add code to

the
BeforePrint event to change the format, but am having problems restoring

the
format as there is no AfterPrint event.

Does anyone have an idea or tip to use for cases like this.

Thank you in advance.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How to Determine PrintJob is Finished with VBA

Thanks a bunch Tom.
The part that I was missing was to disable the events before the printout
command.
Now it works as expected.
Thanks again.

"Tom Ogilvy" wrote in message
...
In beforeprint

make you changes
disable events
issue a command to print
enable evens
change back
' now cancel the original print command
cancel = true
End beforeprint event.

The disadvantage is there is no easy way to differentiate a print preview
from a print command, and both fire the beforeprint event - so you would
force a print when the user only wants a print preview

--
Regards,
Tom Ogilvy

"SFatz" wrote in message
...
I would like to change the format on certain cells on a worksheet when a
user prints the worksheet. Then, after the print is complete, I would

like
to restore the formatting back to its original state. I can add code to

the
BeforePrint event to change the format, but am having problems restoring

the
format as there is no AfterPrint event.

Does anyone have an idea or tip to use for cases like this.

Thank you in advance.






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
Please Help: Macro Nearly Finished Dave Excel Discussion (Misc queries) 1 September 20th 07 12:16 PM
Loop until finished David A. Excel Discussion (Misc queries) 0 September 17th 07 08:00 PM
Loop until finished. David A. Excel Discussion (Misc queries) 0 September 17th 07 08:00 PM
How to know if a sort is finished sucessfully? DamiaoBR Excel Programming 1 April 20th 04 08:38 PM


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